fix: refactor: extract setup_forge() from bin/disinto into lib/forge-setup.sh (#298) #307
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
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: disinto-admin/disinto#307
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-298"
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 #298
Changes
AI Review — Error\n\nReview failed.\n---\n
7070fb9AI Review
Summary\n\nPure structural refactor: moves
setup_forge()and_forgejo_exec()frombin/disintointolib/forge-setup.sh, which is sourced at the top ofbin/disinto. Logic is identical to the removed code.\n\n### Verification\n\n-bin/disintosourceslib/forge-setup.shat line 28 — both functions are available to all callers in the file, including thehire_an_agentcommand's direct use of_forgejo_execat line 2422.\n-_load_init_context()is a new standalone-use guard; the assertions (FORGE_URL,FACTORY_ROOT,PRIMARY_BRANCH) are defensive and do not affect the normal sourced path.\n- No callers outsidebin/disintoreference these functions, so no other files need updating.\n- CI passed.Verdict
APPROVE — Clean extraction of setup_forge() and _forgejo_exec() into lib/forge-setup.sh with no functional changes
Reviewed at
7070fb9| AGENTS.mdAI Review: APPROVE — Clean extraction of setup_forge() and _forgejo_exec() into lib/forge-setup.sh with no functional changes
7070fb960ato74088c5abaAI Review
Summary
This PR does three distinct things: (1) extracts
setup_forge()frombin/disintointolib/forge-setup.sh, (2) renamescheck_memory→memory_guardand addsresolve_forge_remotecalls across all agents, and (3) adds the reproduce-agent infrastructure (Dockerfile, entrypoint, dispatcher dispatch logic, new labels, docker-compose service).Forge extraction
The extraction is clean.
lib/forge-setup.shhas a proper shebang,set -euo pipefail, and a_load_init_context()validator for standalone callers. Behavior improvements over the originalbin/disintocode:lib/forge-setup.sh:163: Admin password reset is now conditional (basic-auth probe before resetting), reducing unnecessary password resets on re-runs. Cleaner than the prior unconditional reset.lib/forge-setup.sh:210: Admin token handling changed from try-create/try-list to delete-existing-then-create-fresh. This is strictly better — always returns a live sha1.lib/forge-setup.sh:239: Same delete-then-recreate pattern for the human token. Addresses #275.Documentation omissions (introduced by this PR)
lib/AGENTS.md:lib/forge-setup.shhas no entry in the lib helper table. The file was created by this PR and provides_forgejo_exec()andsetup_forge()which are critical fordisinto init. The watermark was updated but the table row was not added.lib/AGENTS.md:15:resolve_forge_remote()added tolib/formula-session.sh(line 83) and called by all agents in this PR, but not listed in the formula-session.sh row of the lib table.Both omissions are in files explicitly touched by this PR. They don't break functionality but will confuse future agents reading AGENTS.md. Low priority to fix in a follow-up.
Reproduce infrastructure
dispatch_reproduce()uses an array-baseddocker run(no injection risk), proper pid-file dedup, and graceful no-TOML handling. Image pre-build requirement is implicit — ifdisinto-reproduce:latestdoesn't exist, the container exits silently and the pid-file orphans until the next cycle whenis_reproduce_running()returns false. Acceptable for the current stage.entrypoint-reproduce.shuses stack_lock heartbeat, posts screenshots and labelling via forge API, and creates backlog issues for reproduced bugs. Pattern is consistent with the rest of the factory.docker-compose.ymlreproduce service correctly usesprofiles: ["reproduce"]so it doesn't auto-start with normalup.Remaining call-outs
lib/forge-setup.sh:114,175:admin_userandhuman_userare both hardcoded to"disinto-admin". On re-runs, the freshly generatedhuman_passwon't match the persistedadmin_pass, so the human token delete/recreate will silently fail. This is pre-existing (same in oldbin/disinto) — not introduced by this PR.create_labels()correctly addsneeds-triage,reproduced,cannot-reproducewith distinct hex colours and iterates them in the explicit list.Verdict
APPROVE — Refactor is clean and correct; behavior improvements are solid; two doc omissions noted but don't block
Reviewed at
74088c5| AGENTS.mdAI Review: APPROVE — Refactor is clean and correct; behavior improvements are solid; two doc omissions noted but don't block
Pull request closed