fix: feat(20b): dev-agent reads formula from .profile repo (#85) #94
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-85"
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 #85
Changes
46336142eeto6100722c1e6100722c1etoe06c3030f4e06c3030f4tob289a0dba3AI Review
Summary
This PR adds three new shared helpers to
lib/formula-session.sh:resolve_agent_identity()— looks up the agent's user login via the Forge APIensure_profile_repo()— clones/pulls the agent's.profilerepo from Forgeload_formula_or_profile()— tries the.profileformula first, then falls back toformulas/<role>.tomlPlus a cosmetic refactor of
build_graph_section()to avoid the embeddedprintf.The feature goal is correct and the overall design matches existing patterns (mirrors
ensure_ops_repo). However there is one clear bug.Issues
bug
lib/formula-session.sh:87-96:agent_identitystays empty after auto-resolve. Whenensure_profile_repois called without an argument andAGENT_IDENTITYis unset,resolve_agent_identity()is called and sets the globalAGENT_IDENTITY, but the localagent_identityvariable is never updated. Execution continues past theifblock withagent_identity="", so:PROFILE_REPO_PATHbecomes/home/agent/data/.profile/(trailing slash, no username)clone_urlbecomeshttp://user:token@forgejo//.profile.git(double slash, no user segment)Fix: add
agent_identity="$AGENT_IDENTITY"immediately after theresolve_agent_identitysuccess path.minor
lib/formula-session.sh:175: Error message says "fallback not specified" when a non-emptyfallback_formulapath was provided but the file doesn't exist on disk. Should read "fallback file not found".minor
lib/formula-session.sh:81-83(docstring): ListsFORGE_REPOas a requirement to derive the.profilerepo slug, butFORGE_REPOis never read inside the function — the slug comes fromagent_identitydirectly. Stale comment.What looks good
.profile→ explicit path → constructedformulas/<role>.toml→ clear error|| trueguards on non-critical git ops maintainset -euo pipefailsafetyensure_ops_repo's existing pattern)build_graph_sectionrefactor is correct and more readableVerdict
REQUEST_CHANGES — ensure_profile_repo bug: agent_identity local var stays empty after auto-resolve, producing broken repo paths
Reviewed at
b289a0d| AGENTS.mdAI Review: REQUEST_CHANGES — ensure_profile_repo bug: agent_identity local var stays empty after auto-resolve, producing broken repo paths
b289a0dba3to7f68812a96AI Re-review (round 2)
Previous Findings
lib/formula-session.sh:87-96(agent_identityempty after auto-resolve) → FIXED:agent_identity="$AGENT_IDENTITY"added immediately after theresolve_agent_identitysuccess pathlib/formula-session.sh:175(misleading error message) → FIXED: changed to "fallback file not found"lib/formula-session.sh:81-83(staleFORGE_REPOin docstring) → FIXED: removed from requirements lineAll three findings addressed cleanly. No new issues introduced by the fix commits.
Verdict
APPROVE — all three previous findings fixed; no new issues
Reviewed at
7f68812| Previous:b289a0d| AGENTS.mdAI Re-review (round 2): APPROVE — all three previous findings fixed; no new issues