P4: complete Reginald — capture_work + record_directive #45

Merged
christian merged 2 commits from p4/capture-work into main 2026-07-09 03:01:51 +00:00
Owner

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

  • core capture-work: captureWork forces a single structured decomposition; parseCaptureArgs validates. createIssue on the client (POST /issues).
  • Capture screen: a configured model → "Brew tickets" runs real decomposition, "Approve all" files the set with est/·p/ labels (zero-pollution); scripted demo otherwise. Race fixed (status re-checked at click time).
  • Live-verified against gemma-4-26b: the auth braindump → 3 real tickets, editable, Discard files nothing.

record_directive — the PM's standing intent, logged

  • core directives/record-directive-v0: schema + serialize/parseDirectiveLog (ts-ordered, seq-on-read, corrupt-line-tolerant) + appendDirective (concatenation merge). RECORD_DIRECTIVE_TOOL + system-prompt update.
  • client getFile/putFile (contents API). main: a pm-state client (same token, commitea-pm-state repo — the purity split, D4), appendDirectiveEntry, pmstate:directives read. The Directives screen shows the real ledger when present.
  • Live-verified the model calls record_directive for "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). Create commitea-pm-state (private) in gitea and the directive ledger goes live end-to-end. Everything else is wired; override the name with COMMITEA_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

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 - core `capture-work`: `captureWork` forces a single structured decomposition; `parseCaptureArgs` validates. `createIssue` on the client (`POST /issues`). - Capture screen: a configured model → "Brew tickets" runs real decomposition, "Approve all" files the set with est/*·p/* labels (zero-pollution); scripted demo otherwise. Race fixed (status re-checked at click time). - **Live-verified** against gemma-4-26b: the auth braindump → 3 real tickets, editable, Discard files nothing. ## record_directive — the PM's standing intent, logged - core `directives/record-directive-v0`: schema + serialize/`parseDirectiveLog` (ts-ordered, seq-on-read, corrupt-line-tolerant) + `appendDirective` (concatenation merge). `RECORD_DIRECTIVE_TOOL` + system-prompt update. - client `getFile`/`putFile` (contents API). main: a **pm-state client** (same token, `commitea-pm-state` repo — the purity split, D4), `appendDirectiveEntry`, `pmstate:directives` read. The Directives screen shows the real ledger when present. - **Live-verified** the model calls `record_directive` for *"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). Create **`commitea-pm-state`** (private) in gitea and the directive ledger goes live end-to-end. Everything else is wired; override the name with `COMMITEA_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](https://claude.com/claude-code)
christian added 2 commits 2026-07-09 02:39:44 +00:00
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>
christian merged commit 3d8a320a04 into main 2026-07-09 03:01:51 +00:00
Sign in to join this conversation.
No description provided.