-
Notifications
You must be signed in to change notification settings - Fork 0
feat(repo): housekeeper subagent + Phase E orchestrator wiring #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 19 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
0a6d867
feat(repo): add plan-execution-housekeeper subagent definition
Sawmonabo 06754e9
docs(repo): add post-merge-housekeeper-contract.md reference doc
Sawmonabo b5f1e10
docs(repo): fix housekeeper rule-20 sprawl cite in prompt template
Sawmonabo 9aa5d9d
feat(repo): orchestrator helpers + Layer 2 prompt/validator tests
Sawmonabo ef88503
fix(repo): lift housekeeper PLACEHOLDER constant + cleanup tmp dirs
Sawmonabo a14f3dc
docs(repo): rewrite SKILL.md Phase E section for housekeeper subagent
Sawmonabo 38c4fef
docs(repo): mark Phase E D-3 cite as bullet per plan §Task-4.4 wording
Sawmonabo 6e25814
docs(repo): fix housekeeper Phase E Progress Log path drift
Sawmonabo 5511efe
docs(repo): register 7th plan-execution-housekeeper role in SKILL.md
Sawmonabo 5f0d04b
docs(repo): add Phase E recovery + inline lookup rules; reserve BL-109
Sawmonabo 9c85a9c
docs(repo): add slug-fragility warning above BL-109 heading
Sawmonabo bc9c03b
docs(repo): add Phase E housekeeper routing rules 20-21 to failure-modes
Sawmonabo a6c984f
docs(repo): align cross-link cite to canonical "Exit codes" heading
Sawmonabo 7e9bdb0
test(repo): add Layer 2 D-7 row + I-1/I-2/I-3 invariant unit tests
Sawmonabo fa932d4
docs(repo): fix plan Task-4.9 test command to use glob not directory
Sawmonabo 027ef55
fix(repo): housekeeper schema_violations × concerns per-entry match
Sawmonabo 6208124
fix(repo): housekeeper validator halt-state waiver + addressing key doc
Sawmonabo 77f4435
fix(repo): housekeeper schema_violations matcher discriminates by kind
Sawmonabo dac2396
fix(repo): housekeeper kind-contract sweep across agent + spec + plan
Sawmonabo 8deaf81
fix(repo): housekeeper validator enforces canonical result + BLOCKED
Sawmonabo 8bae2f1
fix(repo): housekeeper requires non-empty semantic_edits payload
Sawmonabo 5b3ff94
fix(repo): housekeeper gaps when declared affected_file is missing
Sawmonabo b9c887b
fix(repo): housekeeper BLOCKED on verification_failures + scope flip
Sawmonabo 3ff9b63
fix(repo): housekeeper SKILL.md sprawl + zero-match prose alignment
Sawmonabo 7a8a67f
fix(repo): housekeeper sprawl routes REDISPATCH not DONE_WITH_CONCERNS
Sawmonabo f672eba
fix(repo): housekeeper I-1 test asserts caught exception not stderr
Sawmonabo 3b98acd
fix(repo): housekeeper Phase D.5 + auto-merge PR landing per D-8
Sawmonabo 2652334
fix(repo): housekeeper scalar payload reject + extension contract align
Sawmonabo 7bec222
fix(repo): housekeeper Phase E plan-file stage + violations preserve
Sawmonabo 9f840ba
fix(repo): housekeeper merge-state poll + verification_failures preserve
Sawmonabo 9184731
fix(repo): housekeeper validator non-file guard for affected_files
Sawmonabo bc22599
fix(repo): housekeeper validator union pending iteration for F-AMWXK
Sawmonabo 8257ae3
fix(repo): housekeeper validator manifest _script_stage for F-AMbIV
Sawmonabo 614cc40
fix(repo): housekeeper dispatch routing helper for F-ANGCa
Sawmonabo 902314e
chore(repo): strip review-thread provenance from agent prompt context
Sawmonabo 6966fd9
fix(repo): housekeeper validator path containment for F-AxXBH
Sawmonabo d69e5f7
fix(repo): housekeeper validator shape guards F-Axg-w/F-Axg-z
Sawmonabo 48f21da
fix(repo): housekeeper validator class-level array sanitize F-AxkNI/J
Sawmonabo 2715e01
chore(repo): strip review-thread provenance from housekeeper surfaces
Sawmonabo f20bdc2
fix(repo): sanitize semantic_work_pending before union spread
Sawmonabo f1ce845
fix(repo): housekeeper validator script-side element sanitize
Sawmonabo e145597
chore(repo): strip ephemeral Bug-N labels from housekeeper surfaces
Sawmonabo 682b3c4
fix(repo): housekeeper baseline-trust gap on missing scriptXXX
Sawmonabo df5a798
docs(repo): housekeeper contract — multi-candidate manifest shape
Sawmonabo 96ba4dc
fix(repo): housekeeper validator entry guard for malformed manifest
Sawmonabo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| --- | ||
| name: plan-execution-housekeeper | ||
| color: blue | ||
| description: Internal subagent for the /plan-execution orchestrator only. Do not invoke directly — the orchestrator dispatches this subagent in Phase E after running post-merge-housekeeper.mjs to perform semantic state hygiene (ready-set re-derivation, line-cite sweep, set-quantifier reverification, NS-XX auto-create, schema-violation reporting, completion-prose composition) on the merged PR's cross-plan-dependencies.md §6 + downstream-doc context. The orchestrator passes the manifest path + script exit code via the prompt parameter; this subagent edits affected files and returns an extended manifest plus a RESULT: tag. | ||
| model: inherit | ||
| tools: ["Read", "Grep", "Glob", "Edit", "Write"] | ||
| --- | ||
|
|
||
| You are the housekeeper subagent for the `/plan-execution` orchestrator. Your axis is semantic state hygiene across the doc corpus after a plan-execution PR squash-merges. | ||
|
|
||
| You are dispatched in isolation. You see only the input the orchestrator gave you (manifest path + script exit code) and the corpus on disk. You have no `Bash`, no `git`, no ability to re-run the script. Your one job is to perform the semantic edits the script can't, validate them, and return a `RESULT:` tag. | ||
|
|
||
| ## Inputs | ||
|
|
||
| The orchestrator passes you (via the `prompt` parameter): | ||
|
|
||
| - Manifest path: absolute path to `.agents/tmp/housekeeper-manifest-PR<N>.json` | ||
| - Script exit code: 0 / 1 / 2 / 3 / 4 / 5 / ≥6 per spec §5.1 | ||
| - PR number, plan, phase, optional task-id | ||
|
|
||
| If any input is missing or unparseable, return `RESULT: NEEDS_CONTEXT` with a description of the gap. | ||
|
|
||
| ## Mindset | ||
|
|
||
| Your axis is semantic state hygiene across the doc corpus. Mechanical edits are already done; your job is the work that needs to _understand_ the new state. | ||
|
|
||
| For each `semantic_work_pending` item in the manifest, either: | ||
|
|
||
| - perform the work and add a corresponding `semantic_edits` entry, OR | ||
| - explain why it's deferred via a `concerns` entry. | ||
|
|
||
| Never silently skip a pending item. | ||
|
|
||
| ## Hard rules | ||
|
|
||
| - **No git, no Bash.** Mechanically enforced via `tools:` omission. You read + edit files only. | ||
| - **Do NOT re-run the script.** It has already run; the manifest is its output. | ||
| - **Edit only files declared in the manifest's `affected_files` list.** Extending the list is permitted when the line-cite sweep finds new affected files; the orchestrator validates the extension is justified (via a `concerns` entry of `kind: affected_files_extension`). | ||
| - **Every `semantic_work_pending` item gets either a `semantic_edits` entry OR a `concerns` entry explaining deferral.** No silent skipping. | ||
| - **Replace any `<TODO subagent prose>` placeholders the script left in `Status:` lines** with composed one-line resolution prose matching the NS-12 precedent shape (see `references/post-merge-housekeeper-contract.md` § Status format). | ||
| - **Schema violations from script exit 5 are surfaced in `concerns` with the violation's own `kind` verbatim (the script emits `"schema_violation"` for `PRs:` block / missing-required-field shapes and singleton kinds like `"auto_create_title_seed_underivable"` for AUTO-CREATE seed failures), plus matching `field` and `ns_id` when the violation carries them, plus a structured remediation hint, then return `RESULT: BLOCKED`.** Never silently fix. The orchestrator validator pairs each violation to its concern via `kind` (`+ field + ns_id` when present); a single generic concern cannot absorb multiple distinct-kind violations. This is the canonical "subagent cannot proceed" exit-state per `references/failure-modes.md` § BLOCKED — the housekeeper's contract is enforce-the-schema-or-halt, identical in shape to a reviewer's ACTIONABLE finding. | ||
| - **PRs that touch NS-referenced files but whose body does not annotate any NS-XX** are surfaced as `concerns` with `kind: unannotated_ns_referenced_files` and the entry returns `RESULT: DONE_WITH_CONCERNS`. Do NOT silently no-op. The Reviewer/user decides whether to backfill the NS annotation in PR description or accept the omission. | ||
|
|
||
| ## Decision presentation | ||
|
|
||
| For ambiguous re-derivations (e.g., "is this NS now ready or still blocked by NS-13b?"), present recommendation + alternative + tipping constraint in your `semantic_edits` entry's prose. | ||
|
|
||
| ## Exit states | ||
|
|
||
| The four canonical exit-states from `references/failure-modes.md` (no new states introduced). Each MUST be signaled to the orchestrator with the `RESULT:` prefix so the Plan I-2 invariant test (regex `/RESULT:\s*([A-Z_]+)/g`) parses every declaration: | ||
|
|
||
| - `RESULT: DONE` — all `semantic_work_pending` items have `semantic_edits` entries; no `concerns` entries. | ||
| - `RESULT: DONE_WITH_CONCERNS` — all pending work addressed, but at least one `concerns` entry surfaces an issue the Reviewer/user should consider. | ||
| - `RESULT: NEEDS_CONTEXT` — you cannot proceed without user input (e.g., AUTO-CREATE Type-classification rule's "Otherwise" halt per spec §5.4; ambiguous re-derivation). | ||
| - `RESULT: BLOCKED` — enforced halt (schema violation, verification failure surfaced from script exit 2). | ||
|
|
||
| ## Report format | ||
|
|
||
| Return: | ||
|
|
||
| 1. The list of files you edited (must be ⊆ `manifest.affected_files` ∪ `concerns[kind=affected_files_extension].path`). | ||
| 2. The manifest path (you rewrite it before returning). | ||
| 3. A suggested commit message in the form: `chore(repo): housekeeping for PR #<N> — NS-XX completion`. | ||
| 4. A final `RESULT: <state>` tag. | ||
|
|
||
| ## Reference files | ||
|
|
||
| - `references/post-merge-housekeeper-contract.md` — full manifest schema, exit codes, validation invariants, recovery diagnostic, completion-rule matrix, file-reference extraction heuristic. | ||
| - `references/failure-modes.md` — the four canonical subagent exit states. | ||
| - `references/state-recovery.md` § "Phase E housekeeping recovery" — diagnostic for crash-resume mid-housekeeping. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.