P4: complete Reginald — capture_work + record_directive #45
Reference in New Issue
Block a user
No description provided.
Delete Branch "p4/capture-work"
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?
Finishes Reginald's tool surface. Two slices in one PR (supersedes the auto-closed #44, which lost its base branch when chat-writes merged): capture_work (braindump → filed issues) and record_directive (the PM's ledger). Branch is cut from
main— no stacking.capture_work — braindump → decomposed issues → filed in gitea
capture-work:captureWorkforces a single structured decomposition;parseCaptureArgsvalidates.createIssueon the client (POST /issues).record_directive — the PM's standing intent, logged
directives/record-directive-v0: schema + serialize/parseDirectiveLog(ts-ordered, seq-on-read, corrupt-line-tolerant) +appendDirective(concatenation merge).RECORD_DIRECTIVE_TOOL+ system-prompt update.getFile/putFile(contents API). main: a pm-state client (same token,commitea-pm-staterepo — the purity split, D4),appendDirectiveEntry,pmstate:directivesread. The Directives screen shows the real ledger when present.record_directivefor "pilots come first" (logs intent, never claims to apply); the append/read + POST/PUT paths are unit-tested.⚠️ One action to fully activate record_directive
The pm-state repo isn't created — my token lacks
write:user(repo creation). Createcommitea-pm-state(private) in gitea and the directive ledger goes live end-to-end. Everything else is wired; override the name withCOMMITEA_PMSTATE_REPO.Verified
116 core tests green (capture + directive + contents-API), desktop typecheck clean, 14 fixture e2e green, 2 gated live tests pass against gemma-4-26b.
Reginald is complete
query_project · propose_change · capture_work · record_directive — Reginald reads the real project, proposes label changes you approve inline, turns braindumps into filed issues, and logs your standing directives. Every number is deterministic code; every mutation is approval-gated.
🤖 Generated with Claude Code
The last big agent capability. In the Capture screen, a rough braindump runs real big-model decomposition into a small, estimated issue set; you review/edit the labels and approve, and the issues are opened in gitea. This is the one place the big model earns its keep (docs/agent-tools.md). core (@commitea/core): - capture-work: PROPOSE_ISSUES_TOOL + CAPTURE_SYSTEM; captureWork(complete, dump) forces a single structured decomposition and returns validated issues; parseCaptureArgs drops blank titles + invalid est/p labels. ProposedIssue / CaptureProposal. - gitea client: createIssue({title, body?, labelIds?}) → POST /issues, normalized. app: - model bridge model:capture runs captureWork on the (loaded) big model. - gitea bridge gitea:createIssues opens each approved issue with its est/* + p/* labels (reusing the #41 label-id resolver — zero-pollution, no invented labels). - Capture screen: when a model is configured, "Brew tickets" runs real capture and "Approve all" files the set; otherwise the scripted demo interview runs. Fixed a race — the brew handler re-checks model status at click time so a configured model never falls into the scripted path before status resolves. Verified: 108 core tests green (7 capture + createIssue added), desktop typecheck clean, 14 fixture e2e green. Gated live e2e against gemma-4-26b: the auth braindump → 3 real tickets ("Resolve token refresh + session staleness" est/3d p/1, "Fix webhook double-firing" est/2d p/2, "Write auth setup docs" est/1d p/3), reviewable and editable; Discard so the test files nothing (createIssue POST is unit-tested). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>The last agent tool. When the PM states standing intent ("pilots come first"), Reginald logs it verbatim to an append-only JSONL ledger in the pm-state repo — a directive is intent; its effects still land through propose_change. This completes Reginald's tool surface: query_project · propose_change · capture_work · record_directive. core (@commitea/core): - directives/record-directive-v0: schema (kind/quote/target/params/rationale + id/ts/status), serialize/parseDirectiveLog (ts-ordered, seq computed on read, corrupt lines skipped), appendDirective (concatenation merge), toDirectiveInput. - RECORD_DIRECTIVE_TOOL + system prompt update ("log standing intent; never claim a change is applied"). - gitea client: getFile/putFile (contents API, base64-agnostic) for the pm-state repo. app: - main: a pm-state client (same token, `commitea-pm-state` repo — the purity split, D4); appendDirectiveEntry (read→append→write, id/ts stamped here), readDirectives. model:chat executes record_directive; pmstate:directives reads the ledger. Degrades cleanly when the pm-state repo is absent. - Directives screen shows the real ledger when present, the fixture demo otherwise. Note: the pm-state repo isn't created yet — my token lacks write:user (repo creation). Create `commitea-pm-state` (private) to activate the live path; all the code + tests are in place. Override with COMMITEA_PMSTATE_REPO. Verified: 116 core tests green (8 directive + 2 contents-API added), desktop typecheck clean, 14 fixture e2e green. Gated live test: the real gemma-4-26b calls record_directive for "pilots come first" (logs intent, doesn't claim to apply it); the append/read + POST/PUT contents paths are unit-tested. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>