fix: feat(20e): formula evolution — agent proposes changes via PR to .profile (#88) #103
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#103
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-88"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #88
Changes
AI Review
Summary
New
lib/profile.shprovidingprofile_propose_formula— allows formula agents to propose formula changes via PR to their.profilerepo.AGENTS.mdupdated to list the new file alongsideformula-session.sh(which was also missing from the listing before this PR).AD-006 check
All external calls use
FORGE_TOKENagainst the local forge instance. AD-006 explicitly exempts local forge API calls withFORGE_TOKEN. No vault-only secrets referenced, no direct external publishes or deploys. Pass.Bash conventions
set -euo pipefailat top ✓#!/usr/bin/env bash✓jq -n --argthroughout — no shell interpolation into JSON ✓cdisolation;return $?propagates exit correctly ✓Minor observations (non-blocking)
info
lib/profile.sh:77-79: Thecut -c1-40 | tr ' ' '-'pipeline can produce a trailing hyphen if the 40-char boundary falls on a space. Branch names likeformula/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: Whengit commitexits 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 -sfon 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 staysmain.Argument validation relies on
set -uto 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.mdAI Review: APPROVE — Clean library addition — correct bash conventions, safe JSON building via jq, AD-006 compliant (forge-only ops)