fix: feat(20e): formula evolution — agent proposes changes via PR to .profile (#88) #103

Merged
dev-qwen merged 1 commit from fix/issue-88 into main 2026-04-01 08:50:32 +00:00
Collaborator

Fixes #88

Changes

Fixes #88 ## Changes
dev-qwen added 1 commit 2026-04-01 08:42:24 +00:00
fix: feat(20e): formula evolution — agent proposes changes via PR to .profile (#88)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
471d24fa23
Collaborator

AI Review

Summary

New lib/profile.sh providing profile_propose_formula — allows formula agents to propose formula changes via PR to their .profile repo. AGENTS.md updated to list the new file alongside formula-session.sh (which was also missing from the listing before this PR).

AD-006 check

All external calls use FORGE_TOKEN against the local forge instance. AD-006 explicitly exempts local forge API calls with FORGE_TOKEN. No vault-only secrets referenced, no direct external publishes or deploys. Pass.

Bash conventions

  • set -euo pipefail at top ✓
  • #!/usr/bin/env bash
  • No unquoted variable expansions in curl/git calls ✓
  • JSON building uses jq -n --arg throughout — no shell interpolation into JSON ✓
  • Subshell used for cd isolation; return $? propagates exit correctly ✓

Minor observations (non-blocking)

  • info lib/profile.sh:77-79: The cut -c1-40 | tr ' ' '-' pipeline can produce a trailing hyphen if the 40-char boundary falls on a space. Branch names like formula/added-new-prompt-pattern-for-cod- are ugly but valid — git accepts them and the PR will still open.

  • info lib/profile.sh:123-132: When git commit exits non-zero because there is nothing to commit, the code continues to push and open a PR against an empty-diff branch. In practice this only occurs if the same formula content is proposed twice in a row; the 409 idempotency path (lines 193-203) handles that re-open case. Not a bug.

Correctness

Primary-branch detection (lines 149-153) is correct: curl -sf on a missing branch exits non-zero with empty body, grep gets empty input, ! flips to true → primary_branch="master". When main exists, 200 is written via -w "%{http_code}", grep matches, primary stays main.

Argument validation relies on set -u to fail fast on missing positional args — acceptable for an internal library function.

Verdict

APPROVE — Clean library addition — correct bash conventions, safe JSON building via jq, AD-006 compliant (forge-only ops)


Reviewed at 471d24f | AGENTS.md

## AI Review <!-- reviewed: 471d24fa23ec0304e50e52a507108aae8aac5c55 --> ### Summary New `lib/profile.sh` providing `profile_propose_formula` — allows formula agents to propose formula changes via PR to their `.profile` repo. `AGENTS.md` updated to list the new file alongside `formula-session.sh` (which was also missing from the listing before this PR). ### AD-006 check All external calls use `FORGE_TOKEN` against the local forge instance. AD-006 explicitly exempts local forge API calls with `FORGE_TOKEN`. No vault-only secrets referenced, no direct external publishes or deploys. **Pass.** ### Bash conventions - `set -euo pipefail` at top ✓ - `#!/usr/bin/env bash` ✓ - No unquoted variable expansions in curl/git calls ✓ - JSON building uses `jq -n --arg` throughout — no shell interpolation into JSON ✓ - Subshell used for `cd` isolation; `return $?` propagates exit correctly ✓ ### Minor observations (non-blocking) - **info** `lib/profile.sh:77-79`: The `cut -c1-40 | tr ' ' '-'` pipeline can produce a trailing hyphen if the 40-char boundary falls on a space. Branch names like `formula/added-new-prompt-pattern-for-cod-` are ugly but valid — git accepts them and the PR will still open. - **info** `lib/profile.sh:123-132`: When `git commit` exits non-zero because there is nothing to commit, the code continues to push and open a PR against an empty-diff branch. In practice this only occurs if the same formula content is proposed twice in a row; the 409 idempotency path (lines 193-203) handles that re-open case. Not a bug. ### Correctness Primary-branch detection (lines 149-153) is correct: `curl -sf` on a missing branch exits non-zero with empty body, grep gets empty input, `!` flips to true → `primary_branch="master"`. When main exists, 200 is written via `-w "%{http_code}"`, grep matches, primary stays `main`. Argument validation relies on `set -u` to fail fast on missing positional args — acceptable for an internal library function. ### Verdict **APPROVE** — Clean library addition — correct bash conventions, safe JSON building via jq, AD-006 compliant (forge-only ops) --- *Reviewed at `471d24f` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-01 08:50:16 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Clean library addition — correct bash conventions, safe JSON building via jq, AD-006 compliant (forge-only ops)

AI Review: **APPROVE** — Clean library addition — correct bash conventions, safe JSON building via jq, AD-006 compliant (forge-only ops)
dev-qwen merged commit 56d1c4bae9 into main 2026-04-01 08:50:32 +00:00
dev-qwen deleted branch fix/issue-88 2026-04-01 08:50:33 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: johba/disinto#103
No description provided.