feat: advance repository records and provenance

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a023c0-a0a3-7c03-b395-5a0d2757214d
This commit is contained in:
tegwick 2026-08-21 22:07:48 +02:00
parent 329af60753
commit 35e86d7b85
24 changed files with 1618 additions and 51 deletions

View file

@ -4,7 +4,7 @@ type: workplan
title: "Coding-assistant commit provenance trailers"
domain: infotech
repo: repo-manager
status: ready
status: active
owner: codex
topic_slug: infotech
created: "2026-08-21"
@ -73,7 +73,7 @@ different mechanism and a different decision.
```task
id: RMGR-WP-0009-T01
status: todo
status: done
priority: high
state_hub_task_id: "39ac4f86-a936-4726-8ad2-d6219f24b1df"
```
@ -108,11 +108,17 @@ purpose — **cut them if they are not wanted**, the scheme works without:
Decide also whether `Co-Authored-By: Claude Opus 5` is kept, folded into
`Assistant-Model`, or dropped. Keeping both duplicates the model.
Result (2026-08-21): the contract is published in
`docs/repository-standards_v0.1.md`. `Assistant` is required when detected;
model, host-qualified process, and session are conditional on availability.
`Assistant-Model` is canonical and assistant-specific `Co-Authored-By`
conventions are deprecated.
## Implement the hook
```task
id: RMGR-WP-0009-T02
status: todo
status: done
priority: high
state_hub_task_id: "7aaccdde-b79f-43ca-b1cd-81c7c3153229"
```
@ -138,11 +144,17 @@ Requirements:
Prefer `core.hooksPath` over per-repo `.git/hooks` (not committable, lost on
clone) and over committed hook files (needs opt-in per repo).
Result (2026-08-21): `.githooks/prepare-commit-msg` is installed globally via
`core.hooksPath=/home/worsch/repo-manager/.githooks`. Tests prove human silence,
exact-token idempotency, and non-blocking behavior. Tool-neutral overrides are
`ASSISTANT_NAME`, `ASSISTANT_MODEL`, `ASSISTANT_PROCESS`, and
`ASSISTANT_SESSION`.
## Wire Claude Code
```task
id: RMGR-WP-0009-T03
status: todo
status: done
priority: high
state_hub_task_id: "f7a29cca-d76c-4205-a33b-3a2276459fce"
```
@ -165,11 +177,16 @@ Once live, retire the `Co-Authored-By` prompt instruction in `~/.claude/CLAUDE.m
per T01's ruling — a hook cannot be forgotten mid-session the way a prompt
instruction can, which is the main reason to prefer it.
Result (2026-08-21): the hook detects `CLAUDECODE`, session id, and PID, accepts
the neutral overrides, and uses `~/.claude/settings.json`'s configured model as
a fallback. No `Co-Authored-By` instruction remains in the current global
Claude instructions, so no external prompt edit was needed.
## Wire Codex
```task
id: RMGR-WP-0009-T04
status: todo
status: done
priority: high
state_hub_task_id: "180e50ff-6d43-46f3-84d2-b5337ff73900"
```
@ -184,11 +201,18 @@ invisible in `git log`, and the one that ran 14 hours alongside a Claude session
If it exports nothing usable, set the variables in its launch wrapper. A stable
per-session value is worth more than the exact PID if only one is available.
Result (2026-08-21): the active Codex CLI exports `CODEX_SESSION_ID` and
`CODEX_THREAD_ID`; the hook uses the former as the stable session and reads the
configured model from `$CODEX_HOME/config.toml` (or `~/.codex/config.toml`) when
no exact neutral override is present. Codex's published stable environment
variable reference does not promise those session variables, so they remain a
best-effort compatibility input rather than the contract.
## Wire Grok
```task
id: RMGR-WP-0009-T05
status: todo
status: done
priority: medium
state_hub_task_id: "b8451fe8-233f-4862-a238-5ee84901e7fb"
```
@ -196,11 +220,16 @@ state_hub_task_id: "b8451fe8-233f-4862-a238-5ee84901e7fb"
Same discovery for Grok. Lowest priority of the three only because it appears
least in current history — confirm that is still true before deciding.
Result (2026-08-21): the installed Grok client exposes `GROK_SESSION_ID` and
`GROK_DEFAULT_MODEL` integration points; the hook consumes both and also accepts
the neutral override contract. No Grok process was active during cutover, so
its next real commit remains the operational proof rather than inferred history.
## Report on assistant activity and collisions
```task
id: RMGR-WP-0009-T06
status: todo
status: done
priority: medium
state_hub_task_id: "a28d9287-b488-4946-bf46-6cad1a392778"
```
@ -217,11 +246,15 @@ The trailers are the input; this is the payoff. An `rmgr` report over
Keep it read-only over git. Do not add a hub table: this is derivable from the
repositories, and `state-hub` is being retired under `STATE-WP-0079`.
Result (2026-08-21): `rmgr assistant-provenance report` derives assistant,
model, process, session, unattributed buckets, and interleaved-session pairs
from Git history only. Regression coverage includes an A→B→A interleave.
## Handle existing history
```task
id: RMGR-WP-0009-T07
status: todo
status: done
priority: low
state_hub_task_id: "e4ff1ab5-3507-4dff-bb0d-3fed3e0be80f"
```
@ -238,11 +271,18 @@ Also decide the `custodian-sync` identity's treatment: it is automation with its
own committer identity already, so it likely needs no trailer — but it should be
named in the standard so it is not later mistaken for an unwired assistant.
Result (2026-08-21): history remains untouched and `custodian-sync` is
declared known automation exempt from assistant trailers. The configuration and
report distinguish before/after cutover at first attributed commit
`329af60753b20896f30f098e8f75074652780032`. A naturally occurring
multi-session window remains an acceptance proof for the plan, not a reason to
misclassify the cutover task as incomplete.
## Acceptance
- [ ] Trailer contract published in `docs/repository-standards_v0.1.md`
- [ ] Hook live via `core.hooksPath`; never blocks, idempotent, silent for humans
- [ ] Claude, Codex, and Grok each emit trailers, or are recorded as unable with a reason
- [ ] `git log` alone answers "which assistant, which model, which session"
- [x] Trailer contract published in `docs/repository-standards_v0.1.md`
- [x] Hook live via `core.hooksPath`; never blocks, idempotent, silent for humans
- [x] Claude, Codex, and Grok each emit trailers, or are recorded as unable with a reason
- [x] `git log` alone answers "which assistant, which model, which session"
- [ ] Overlapping-session report runs against at least one real collision window
- [ ] Cutover commit recorded; pre-cutover history reported as unknown, not inferred
- [x] Cutover commit recorded; pre-cutover history reported as unknown, not inferred