Reframe sweep M7-27 + capstone (AI drives git, lesson=theory, de-slop) (#93)
Sync course wiki / sync-wiki (push) Successful in 11s

Co-authored-by: claude <claude@jpaul.io>
Co-committed-by: claude <claude@jpaul.io>
This commit was merged in pull request #93.
This commit is contained in:
2026-06-22 21:58:36 -04:00
committed by Claude (agent)
parent a29823f4b3
commit 513d7e7ac8
38 changed files with 1735 additions and 1424 deletions
+5 -5
View File
@@ -4,7 +4,7 @@ Stands in for a forge-native triage agent (triggered when an issue opens) withou
It assembles the prompt, then validates and renders the AI's suggestion — and stops at a human
confirm. The agent proposes labels and a route; it does not apply them.
python triage.py prompt # taxonomy + issue -> prompt. Paste to your AI.
python triage.py prompt # taxonomy + issue -> prompt for the agent
python triage.py apply ai-triage.sample.json # validate + render + confirm gate
The validation step matters: the agent may only use labels that exist in label-taxonomy.md. A
@@ -42,9 +42,9 @@ def allowed_labels(taxonomy_text: str) -> set[str]:
def load_json_response(path: Path):
"""Parse the JSON the AI returned.
Chat assistants very often wrap their output in a ```json ... ``` code fence (or add a line of
prose) even when told to "return only the JSON" so a strict json.loads on the raw paste fails
on the most likely real output. Try a strict parse first; if that fails, fall back to the
Chat assistants very often wrap their output in a ```json ... ``` code fence (or add a stray
line of text) even when told to "return only the JSON", so a strict json.loads on the raw paste
fails on the most likely real output. Try a strict parse first; if that fails, fall back to the
outermost { ... } block, which survives a code fence or surrounding text. Stdlib only."""
raw = path.read_text()
try:
@@ -109,7 +109,7 @@ def main(argv: list[str]) -> int:
parser = argparse.ArgumentParser(description=__doc__)
sub = parser.add_subparsers(dest="cmd", required=True)
p = sub.add_parser("prompt", help="assemble the triage prompt to paste to your AI")
p = sub.add_parser("prompt", help="assemble the triage prompt for the agent to act on")
p.add_argument("--taxonomy", default=str(HERE / "label-taxonomy.md"))
p.add_argument("--issue", default=str(HERE / "sample-issue.md"))
p.set_defaults(func=cmd_prompt)