From 3aca03a06b8771e64a9bc8bbf4e6caafb9467d52 Mon Sep 17 00:00:00 2001 From: Agent Date: Wed, 1 Apr 2026 10:57:26 +0000 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20feat(96d):=20architect=20formula=20?= =?UTF-8?q?=E2=80=94=20answer=20parsing=20+=20sub-issue=20filing=20(#102)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- formulas/run-architect.toml | 92 +++++++++++++++++++++++++++++++++---- 1 file changed, 84 insertions(+), 8 deletions(-) diff --git a/formulas/run-architect.toml b/formulas/run-architect.toml index c813ca6..3a1c506 100644 --- a/formulas/run-architect.toml +++ b/formulas/run-architect.toml @@ -216,13 +216,89 @@ title = "Answer parsing + sub-issue filing (issue #102)" description = """ This step processes human answers to design questions and files sub-issues. -Actions: -1. Monitor PR comments for human responses to design questions -2. Parse answers and extract design decisions -3. File concrete sub-issues for each accepted design fork path -4. Close or update the sprint PR based on decisions +## Preflight: Detect PRs in question phase -Output: -- Sub-issues filed in disinto repo with proper dependencies -- Sprint PR updated or closed based on design decisions +An architect PR is in the question phase if ALL of the following are true: +- PR is open +- PR body or sprint spec file contains a `## Design forks` section (added by #101 after ACCEPT) +- PR has question comments (Q1, Q2, Q3... format) + +## Answer parsing + +Human comments on the PR use this format: +``` +Q1: A +Q2: B +Q3: A +``` + +Parser matches lines starting with `Q` + digit(s) + `:` + space + letter A-D (case insensitive). +Ignore other content in the comment. + +## Processing paths + +### All questions answered (every `### Q` heading has a matching `Q: ` comment) + +1. Parse each answer (e.g. `Q1: A`, `Q2: C`) +2. Read the sprint spec from the PR branch +3. Generate final sub-issues based on answers: + - Each sub-issue uses the appropriate issue template (bug/feature/refactor from `.codeberg/ISSUE_TEMPLATE/`) + - Fill all template fields: + - Problem/motivation (feature) or What's broken (bug/refactor) + - Proposed solution (feature) or Approach (refactor) or Steps to reproduce (bug) + - Affected files (max 3) + - Acceptance criteria (max 5) + - Dependencies + - File via Forgejo API on the **disinto repo** (not ops repo) + - Label as `backlog` +4. Comment on PR: "Sprint filed: #N, #N, #N" +5. Merge the PR (sprint spec with answers persists in `ops/sprints/`) + +### Some questions answered, not all + +1. Acknowledge answers received +2. Comment listing remaining unanswered questions +3. Signal PHASE:done (check again next poll) + +### No answers yet (questions posted but human hasn't responded) + +1. Skip — signal PHASE:done + +## Forgejo API for filing issues on disinto repo + +All operations use the Forgejo API with `Authorization: token ${FORGE_TOKEN}` header. + +### Create issue +``` +POST /repos/{owner}/{repo}/issues +Body: { + "title": "", + "body": "", + "labels": [123], // backlog label ID + "assignees": ["architect-bot"] +} +``` + +### Close PR +``` +PATCH /repos/{owner}/{repo}/pulls/{index} +Body: {"state": "closed"} +``` + +### Merge PR (merge with squash) +``` +MERGE /repos/{owner}/{repo}/pulls/{index} +Body: {"merge_base": "main", "method": "merge"} +``` + +### Post comment on PR +``` +POST /repos/{owner}/{repo}/pulls/{index}/comments +Body: {"body": ""} +``` + +### Get label ID +``` +GET /repos/{owner}/{repo}/labels +``` """ -- 2.49.1 From d315c7986630e3d2cd2820a957b6799b797b870f Mon Sep 17 00:00:00 2001 From: Agent Date: Wed, 1 Apr 2026 11:08:37 +0000 Subject: [PATCH 2/2] fix: correct Forgejo API references for merge and comments --- formulas/run-architect.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/formulas/run-architect.toml b/formulas/run-architect.toml index 3a1c506..cd8010a 100644 --- a/formulas/run-architect.toml +++ b/formulas/run-architect.toml @@ -285,15 +285,15 @@ PATCH /repos/{owner}/{repo}/pulls/{index} Body: {"state": "closed"} ``` -### Merge PR (merge with squash) +### Merge PR ``` -MERGE /repos/{owner}/{repo}/pulls/{index} -Body: {"merge_base": "main", "method": "merge"} +POST /repos/{owner}/{repo}/pulls/{index}/merge +Body: {"Do": "merge"} ``` -### Post comment on PR +### Post comment on PR (via issues endpoint) ``` -POST /repos/{owner}/{repo}/pulls/{index}/comments +POST /repos/{owner}/{repo}/issues/{index}/comments Body: {"body": ""} ``` -- 2.49.1