Conversation
… repo-architect - Add WorkItem dataclass and durable work_state.json (memory lane) - Add select_ready_issue() with deterministic priority-ordered selection - Add delegate_to_copilot() with dry-run/live mode and GitHub API integration - Add reconcile_pr_state() ingesting open/merged/closed/stale PR outcomes - Add run_execution_cycle() and run_reconciliation_cycle() entry points - Update run_issue_cycle() to filter out already-in-progress fingerprints - Add lifecycle labels: ready-for-delegation, in-progress, pr-open, merged, blocked, superseded - Add OBJECTIVE_LABELS dict with 7 canonical architectural objectives - Extend Config with 7 new operator control fields - Validate new env vars: ACTIVE_OBJECTIVE, ENABLE_LIVE_DELEGATION, MAX_CONCURRENT_DELEGATED, STALE_TIMEOUT_DAYS, RECONCILIATION_WINDOW_DAYS - Add --mode execution/reconcile CLI args + operator flags - Add dedicated workflow files: repo-architect-execution.yml (every 2h), repo-architect-reconcile.yml (every 4h) - Simplify repo-architect.yml schedule to planning only; remove invalid github.event.schedule conditions - Add 47 new tests across 7 test classes (231 total, all passing) - Rewrite OPERATOR_GUIDE.md to document all four lanes, work state schema, label lifecycle, dry-run vs live, and scheduled automation Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
|
You are working on PR #65 in BraveNewCapital/GodelOS_StrangeDevLoop. Read first and treat as authoritative:
Your task is to harden the closed-loop repo-architect execution system so it is operationally trustworthy rather than merely plausible. Do not stop at analysis. Current weak points to fix
Required implementation changes A. Make delegation verifiable Implement delegation so the system can prove what happened. Required behavior:
Do not treat “label added” alone as proof of actual execution. Update docs and tests accordingly. B. Strengthen issue-to-PR linkage Implement stronger PR association than plain Use as many reliable signals as are available and practical, in priority order:
When repo-architect delegates an issue, ensure the issue body/comment includes the machine-readable linkage material Copilot should carry into the PR. When reconciling, prefer exact machine linkage over loose textual inference. Update tests for:
C. Replace interpretive lifecycle states with factual states Do not encode assumptions as labels or state names. Replace or refactor lifecycle/state handling so facts are represented directly, for example:
The exact naming can differ, but it must separate:
Do not label a closed unmerged PR as superseded unless there is explicit evidence of a superseding issue/PR. Planning may infer that stale work should be deprioritized, but the stored state must remain factual. D. Tighten reconciliation rules Update reconcile_pr_state() so it:
Persist reconciliation evidence in work state. E. Update work state schema Extend
Keep the schema machine-readable and documented. F. Update operator docs Document:
G. Update tests Add or update hermetic tests for:
Constraints
Success condition This task is complete only when:
When done, output a concise summary with these headings:
|
…d factual lifecycle states Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Implemented in commit This hardens delegation with explicit requested/confirmed/failed/unconfirmed outcomes plus mechanism evidence, strengthens PR linkage matching with ordered evidence methods and confidence tracking, separates factual lifecycle state from inferred planning state, persists reconciliation evidence in work state, updates operator docs, and adds hermetic tests for delegation proof, linkage methods (including ambiguous/no-match), and factual lifecycle transitions. |
🧪 CI — Python 3.10 |
🧪 CI — Python 3.11 |
|
The delegation contract needs tightening. GitHub Copilot coding agent is triggered by assigning the issue to Copilot. The issue body, description, and any comments that already exist at the time of assignment are sent to the agent. After assignment, Copilot does not react to further issue comments. That means the current live path should treat assignment as the actual execution trigger, while any delegation comment is audit-only rather than part of the trigger/confirmation contract. Required changes:
Also note that Copilot PR workflows are not triggered by default until a user with write access approves them, unless repository settings allow automatic workflow runs. The closed-loop automation docs should account for that gate explicitly. |
|
…t linkage comment before assignment, document workflow approval gate Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
…ence Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Implemented in
|
There was a problem hiding this comment.
Pull request overview
This PR extends repo_architect.py from issue-first governance into a closed-loop system by introducing a durable work-state “memory lane”, an execution lane to delegate ready issues to the GitHub Copilot coding agent, and a reconciliation lane to ingest PR outcomes back into work state.
Changes:
- Add durable
.agent/work_state.jsontracking (WorkItem), issue selection (execution), and PR reconciliation (reconcile) flows inrepo_architect.py. - Add extensive unittest coverage for work state ingestion, selection/delegation behavior, and PR reconciliation.
- Update operator documentation and introduce dedicated scheduled workflows for execution and reconciliation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
repo_architect.py |
Adds work-state persistence + execution/reconcile modes, selection/delegation logic, and PR linkage reconciliation. |
tests/test_repo_architect.py |
Adds new test suites validating the new work-state/execution/reconcile behaviors. |
docs/repo_architect/OPERATOR_GUIDE.md |
Documents the four-lane model, new modes, labels, and workflows. |
.github/workflows/repo-architect.yml |
Updates dispatch inputs to mention new modes and expands schedule description. |
.github/workflows/repo-architect-execution.yml |
New scheduled/manual workflow to run execution lane. |
.github/workflows/repo-architect-reconcile.yml |
New scheduled/manual workflow to run reconciliation lane. |
repo_architect.py
Outdated
| new_it["updated_at"] = now | ||
| new_it["run_id"] = run_id | ||
| new_it.setdefault("lifecycle_fact_state", "ready-for-delegation") | ||
| upsert_work_item(work_state, WorkItem(**new_it)) |
repo_architect.py
Outdated
| ] | ||
| if filtered_gaps: | ||
| gaps = filtered_gaps | ||
| # If all gaps are filtered, still proceed with original list so planner isn't blocked |
| # Fetch eligible issues from GitHub | ||
| candidate_issues = _list_github_issues_by_labels( | ||
| config, list(EXECUTION_ELIGIBLE_LABELS), state="open" | ||
| ) | ||
|
|
||
| filtered: List[Tuple[Dict[str, Any], Optional[str], Optional[str]]] = [] | ||
| blocking_lifecycle = { | ||
| "blocked-by-dependency", "superseded-by-issue", "superseded-by-pr", | ||
| "delegation-requested", "in-progress", "pr-open", "pr-draft", | ||
| "merged", "closed-unmerged", "failed-delegation", | ||
| } | set(LEGACY_LIFECYCLE_LABELS) | ||
|
|
||
| for issue in candidate_issues: | ||
| issue_labels: Set[str] = { | ||
| lbl["name"] | ||
| for lbl in issue.get("labels", []) | ||
| if isinstance(lbl, dict) | ||
| } |
| filtered: List[Tuple[Dict[str, Any], Optional[str], Optional[str]]] = [] | ||
| blocking_lifecycle = { | ||
| "blocked-by-dependency", "superseded-by-issue", "superseded-by-pr", | ||
| "delegation-requested", "in-progress", "pr-open", "pr-draft", | ||
| "merged", "closed-unmerged", "failed-delegation", | ||
| } | set(LEGACY_LIFECYCLE_LABELS) | ||
|
|
| - name: Ensure artifact directories exist | ||
| run: mkdir -p .agent docs/repo_architect | ||
|
|
||
| - name: Run repo architect (execution mode) | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} |
|
|
||
| - name: Ensure artifact directories exist | ||
| run: mkdir -p .agent docs/repo_architect | ||
|
|
| default: 'parse_errors,import_cycles,entrypoint_consolidation,hygiene,report' | ||
| type: string | ||
| schedule: | ||
| # Planning: hourly gap detection and issue synthesis | ||
| - cron: '17 * * * *' | ||
|
|
||
| concurrency: |
.github/workflows/repo-architect.yml
Outdated
| description: 'Operating mode. ''issue'' (default safe governance mode). ''execution'' selects one ready issue and delegates to Copilot. ''reconcile'' ingests PR outcomes. ''analyze'' is read-only. ''report''/''mutate''/''campaign'' are charter-validated mutation-capable modes (§9–§11).' | ||
| required: true | ||
| default: 'issue' | ||
| type: choice | ||
| options: | ||
| - issue | ||
| - execution | ||
| - reconcile |
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write |
|
@copilot apply changes based on the comments in this thread |
…ing, gap filtering, workflow persistence, permissions Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
… level Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
All 9 review comments addressed in commits
251 tests passing, CodeQL 0 alerts. |
|
The branch may now be correct, but the visible PR contract is still stale. The current PR description still says:
If the latest commits changed those semantics, the PR description/docs need to be updated to match the actual code before merge. Please make the PR self-consistent:
Right now the branch may be ahead of the PR narrative, but the merge surface still advertises the older contract. |
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Updated in The operator guide now states that assignment is the sole execution trigger, the pre-assignment linkage comment is audit-only context, post-assignment issue comments do not affect Copilot, the lifecycle/reconciliation wording reflects the factual state model, and the visible PR checklist now reflects the current 251-test count. No UI changes in this update. |
Description
Extends
repo_architectfrom a stateless issue synthesiser into a four-lane continuous loop without replacing the issue-first governance model, and hardens the loop so delegation and reconciliation are auditable with machine-readable proof rather than optimistic inference.Planning lane
run_issue_cycleloads.agent/work_state.jsonbefore planning and suppresses gaps whose fingerprints are already actively delegatedExecution lane (
--mode execution)select_ready_issue()is deterministic and testable: eligible labels (arch-gap+copilot-task+needs-implementation) → blocking factual lifecycle exclusion (includingready-for-validation) → fingerprint/issue-number dedupe → per-lane concurrency guard →MAX_CONCURRENT_DELEGATEDcap → priority sort (critical>high>medium>low)_list_github_issues_by_labels()now filters out pull requests returned by the GitHub/issuesendpoint so only real issues can be delegateddelegate_to_copilot()records factual delegation outcomes:delegation-requesteddelegation-confirmeddelegation-faileddelegation-unconfirmeddelegation_mechanismis"assignment"delegation_events[]are persisted in work state with timestamp, mechanism, target issue, and outcomeReconciliation lane (
--mode reconcile)#issue_numbermatching with ordered evidence linkage:repo-architect-linkageblock in PR body#issue_numbermentionreconcile_pr_state()records:pr_match_methodpr_match_confidence(exact/strong/weak)pr_match_evidencemerged,closed_unmerged,draft,open,staleMemory lane / schema updates
.agent/work_state.jsonremains the memory substrate and now includes proof fields for delegation and PR matching:delegation_mechanismdelegation_requested_atdelegation_confirmed_atdelegation_confirmation_evidencedelegation_comment_urldelegation_comment_iddelegation_assignment_evidencepr_match_methodpr_match_confidencepr_match_evidencelifecycle_fact_statelifecycle_inferred_state_normalize_work_item_dict(), which drops unknown keys and fills defaults for missing required fields_WORK_ITEM_FIELDSand_WORK_ITEM_REQUIRED_DEFAULTSavoid repeated reflection overhead during normalizationLifecycle semantics
Lifecycle labels now represent observed facts:
ready-for-delegationdelegation-requestedin-progresspr-openpr-draftmergedclosed-unmergedstaleblocked-by-dependencysuperseded-by-issuesuperseded-by-prfailed-delegationCorrected prior assumptions:
closed-unmergedis not automatically mapped to supersededstaleis not automatically mapped to blocked-by-dependencyWorkflows
repo-architect.ymlremains the planning-oriented workflow and no longer advertisesexecution/reconciledispatch modes that it does not runrepo-architect-execution.ymlis the dedicated execution schedule and now haspull-requests: readrepo-architect-reconcile.ymlis the dedicated reconciliation schedule withpull-requests: read.agent/work_state.jsonacross runs via versioned cache keys (repo-architect-work-state-v1-*)Documentation
docs/repo_architect/OPERATOR_GUIDE.mdwas updated to match the implemented contract:#issue_numberTests
_list_github_issues_by_labels()ready-for-validationblocking delegationRelated Issues
Test Evidence
CodeQL: 0 alerts (actions + python)
Code review tool: no actionable comments
Checklist
pytest tests/)black .andisort .)Original prompt
Implement Continuous Issue → Execution → PR → Ingestion → Replanning Loop for repo-architect
Context
You are working inside
BraveNewCapital/GodelOS_StrangeDevLoop. The repo-architect system currently generates bounded implementation issues (issue-first governance). Your task is to extend it into a closed, stateful execution loop without replacing the issue-first model.Read these files first — treat them as authoritative
docs/architecture/GODELOS_ARCHITECTURAL_CHARTER.mddocs/architecture/GODELOS_REPO_IMPLEMENTATION_CHARTER.mddocs/repo_architect/OPERATOR_GUIDE.mdrepo_architect.py.github/workflows/repo-architect.ymlGoal
Keep issue-first governance as the default planning mode, but close the loop so that:
Target Architecture
Hard Constraints
Implementation Requirements
1. Add Durable Work-State Ingestion
Implement a machine-readable state layer (prefer JSON) that records at minimum:
objectivelaneissue_numberissue_fingerprintissue_statedelegation_stateassigneepr_number/pr_url(if any)pr_statemerged/closedoutcomeblocked/supersededstatuscreated_at/updated_attimestampsrun_idor workflow provenanceUse
reports/or an existing state location if appropriate. Make it easy forrepo_architect.pyto read and update.2. Add Issue Execution Selection
Implement deterministic, testable logic that selects one ready issue for execution.
Selection rules:
arch-gap,copilot-task,needs-implementation3. Add Copilot Delegation Support
Implement an execution path that delegates a selected issue to GitHub Copilot coding agent.
Support:
workflow_dispatchas appropriate)Do not fake delegation. Use actual repository mechanisms that fit GitHub + Copilot workflow.
4. Add PR Reconciliation
Implement ingestion of PR state back into repo-architect state.
For issues created/generated by repo-architect, detect:
Update issue/work state accordingly so reconciliation can answer:
5. Make Planning Stateful
Update planning so the next planning pass ingests:
Use this to avoid:
Planning should be objective-aware. Add or extend an objective concept such as:
restore-parse-correctnesseliminate-import-cyclesconverge-runtime-structurereduce-architecture-score-riskEach new issue should advance a concrete objective; the next issue should prefer the next bounded step in that objective.
6. Add...
This pull request was created from Copilot chat.
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.