2026-08-09 23:04:49 +02:00
|
|
|
|
---
|
|
|
|
|
|
id: RMGR-WP-0002
|
|
|
|
|
|
type: workplan
|
|
|
|
|
|
title: "Retirement dual-run: SH adapter for writeback and reconcile"
|
|
|
|
|
|
domain: infotech
|
|
|
|
|
|
repo: repo-manager
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
status: finished
|
2026-08-09 23:04:49 +02:00
|
|
|
|
owner: codex
|
|
|
|
|
|
topic_slug: repo-manager
|
|
|
|
|
|
created: "2026-08-09"
|
|
|
|
|
|
updated: "2026-08-09"
|
|
|
|
|
|
parent_project: prj-state-hub-retirement
|
|
|
|
|
|
parent_workplan: SHR-WP-0001
|
|
|
|
|
|
stream: S1
|
|
|
|
|
|
related:
|
|
|
|
|
|
- RMGR-WP-0001
|
|
|
|
|
|
- STATE-WP-0079
|
|
|
|
|
|
- ACTIVITY-WP-0029
|
|
|
|
|
|
- specs/ArchitectureBlueprint.md
|
|
|
|
|
|
- history/2026-08-09-state-hub-repo-tooling-research.md
|
2026-08-25 20:21:52 +02:00
|
|
|
|
state_hub_workstream_id: "195ae0e8-79b0-5593-a491-b5a159ab64b7"
|
2026-08-09 23:04:49 +02:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
# Retirement dual-run: SH adapter for writeback and reconcile
|
|
|
|
|
|
|
|
|
|
|
|
## Goal
|
|
|
|
|
|
|
|
|
|
|
|
Close in on **State Hub retirement of repository checkout mutation** by making
|
|
|
|
|
|
Repo Manager the executor for the highest-value write path and for reconcile,
|
|
|
|
|
|
behind a **State Hub dual-run facade**—not by refactoring RM for cleanliness.
|
|
|
|
|
|
|
|
|
|
|
|
Success is measured by: agent task-status updates and fix-consistency can run
|
|
|
|
|
|
with **Git evidence produced by Repo Manager**, while State Hub remains the
|
|
|
|
|
|
MCP/REST entrypoint until meters allow cutover (Blueprint Stage B → toward D).
|
|
|
|
|
|
|
|
|
|
|
|
**Out of scope for this workplan:** dashboard UX, SBOM product work, full MCP
|
|
|
|
|
|
rewrite, topic-spine cleanup, generic framework polish, expanding command catalog
|
|
|
|
|
|
beyond what dual-run requires.
|
|
|
|
|
|
|
|
|
|
|
|
## Blueprint alignment
|
|
|
|
|
|
|
|
|
|
|
|
See `specs/ArchitectureBlueprint.md` §4–§9. This WP is Stage B.
|
|
|
|
|
|
|
|
|
|
|
|
## Define dual-run feature flags and success meters
|
|
|
|
|
|
|
|
|
|
|
|
```task
|
|
|
|
|
|
id: RMGR-WP-0002-T01
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
status: done
|
2026-08-09 23:04:49 +02:00
|
|
|
|
priority: high
|
2026-08-25 20:21:52 +02:00
|
|
|
|
state_hub_task_id: "a7d18cdc-d316-506e-830c-22da0e79bd58"
|
2026-08-09 23:04:49 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Specify flags (e.g. `RM_WRITEBACK=1`, `RM_RECONCILE=1`) and a minimal meter:
|
|
|
|
|
|
count of checkout mutations by source `state-hub` vs `repo-manager`. Document
|
|
|
|
|
|
rollback (flag off → SH native path). No new product metrics frameworks.
|
|
|
|
|
|
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
**Result:** `dual_run.py` + `docs/dual-run.md`; `rmgr dual-run-status`.
|
|
|
|
|
|
|
2026-08-09 23:04:49 +02:00
|
|
|
|
## Productionize task-status command for dual-run
|
|
|
|
|
|
|
|
|
|
|
|
```task
|
|
|
|
|
|
id: RMGR-WP-0002-T02
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
status: done
|
2026-08-09 23:04:49 +02:00
|
|
|
|
priority: high
|
2026-08-25 20:21:52 +02:00
|
|
|
|
state_hub_task_id: "ab7120f9-874f-5120-970f-e834143192dc"
|
2026-08-09 23:04:49 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Harden `repo.work.update_task_status` from the T05 slice for dual-run use:
|
|
|
|
|
|
idempotency key, expected_head_sha optional, push-seal compatible behavior
|
|
|
|
|
|
(or explicit handoff to existing SH push-seal once), failure codes matching
|
|
|
|
|
|
CMD-0001. Keep CLI; add thin HTTP only if SH adapter requires it.
|
|
|
|
|
|
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
**Result:** UUID match, idempotency store, expected_head_sha, optional `--push`.
|
|
|
|
|
|
|
2026-08-09 23:04:49 +02:00
|
|
|
|
## State Hub facade: route update_task_status to RM when flagged
|
|
|
|
|
|
|
|
|
|
|
|
```task
|
|
|
|
|
|
id: RMGR-WP-0002-T03
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
status: done
|
2026-08-09 23:04:49 +02:00
|
|
|
|
priority: high
|
2026-08-25 20:21:52 +02:00
|
|
|
|
state_hub_task_id: "b14c0996-fa29-568c-8fa4-6278bd2e2c3f"
|
2026-08-09 23:04:49 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
In **state-hub** (child change under this coordination): when flag on, MCP/REST
|
|
|
|
|
|
task status updates call RM command for file+git evidence, then refresh SH index
|
|
|
|
|
|
as needed. When flag off, preserve current behavior. Compatibility test: same
|
|
|
|
|
|
file result as native SH writeback on golden fixtures.
|
|
|
|
|
|
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
**Result:** `api/services/repo_manager_dual_run.py` + PATCH `/tasks` hook;
|
|
|
|
|
|
C-15 path also dual-runs.
|
2026-08-09 23:04:49 +02:00
|
|
|
|
|
|
|
|
|
|
## Dual-run reconcile: SH fix-consistency delegates to RM when flagged
|
|
|
|
|
|
|
|
|
|
|
|
```task
|
|
|
|
|
|
id: RMGR-WP-0002-T04
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
status: done
|
2026-08-09 23:04:49 +02:00
|
|
|
|
priority: high
|
2026-08-25 20:21:52 +02:00
|
|
|
|
state_hub_task_id: "1cb43273-94a3-50d7-9b9b-6243dc259704"
|
2026-08-09 23:04:49 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Port or wrap the **minimum** C-rules needed so `statehub fix-consistency --fix`
|
|
|
|
|
|
(or a feature-flagged path) can execute reconcile via RM for a pilot repo set.
|
|
|
|
|
|
Inbox C-rules stay on SH/hub-core. Goal: SH process stops implementing new
|
|
|
|
|
|
reconcile logic; it proxies.
|
|
|
|
|
|
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
**Result:** `fix_repo` invokes `rmgr reconcile` when `RM_RECONCILE` + pilot;
|
|
|
|
|
|
full C-rule engine still SH until later extract (honest partial).
|
|
|
|
|
|
|
2026-08-09 23:04:49 +02:00
|
|
|
|
## Pilot cutover on one non-critical repo
|
|
|
|
|
|
|
|
|
|
|
|
```task
|
|
|
|
|
|
id: RMGR-WP-0002-T05
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
status: done
|
2026-08-09 23:04:49 +02:00
|
|
|
|
priority: high
|
2026-08-25 20:21:52 +02:00
|
|
|
|
state_hub_task_id: "bb32ae50-b056-5c37-a060-d92a1495f85d"
|
2026-08-09 23:04:49 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Enable flags for **one** agreed pilot repo (e.g. repo-manager itself or a
|
|
|
|
|
|
low-risk tooling repo). Run agent task status + fix-consistency for ≥1 session.
|
|
|
|
|
|
Capture evidence: before/after git SHAs, meter counts, no data loss. Document
|
|
|
|
|
|
operator rollback.
|
|
|
|
|
|
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
**Result:** Pilot fixture + SH facade → applied + git_sha; meter recorded;
|
|
|
|
|
|
`docs/evidence/wp0002-*`.
|
|
|
|
|
|
|
2026-08-09 23:04:49 +02:00
|
|
|
|
## Hand evidence to STATE-WP-0079 / project gates
|
|
|
|
|
|
|
|
|
|
|
|
```task
|
|
|
|
|
|
id: RMGR-WP-0002-T06
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
status: done
|
2026-08-09 23:04:49 +02:00
|
|
|
|
priority: medium
|
2026-08-25 20:21:52 +02:00
|
|
|
|
state_hub_task_id: "be12491c-67e0-572a-8b9b-68e41a670427"
|
2026-08-09 23:04:49 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Write cutover evidence under `docs/evidence/` and link from STATE-WP-0079 /
|
|
|
|
|
|
G-RMGR notes so the retirement program can expand the flag fleet-wide. No extra
|
|
|
|
|
|
architecture rewrite—just retirement evidence.
|
|
|
|
|
|
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
**Result:** `docs/evidence/wp0002-completion.md`; note on STATE-WP-0079.
|
|
|
|
|
|
|
2026-08-09 23:04:49 +02:00
|
|
|
|
## Acceptance
|
|
|
|
|
|
|
feat(RMGR-WP-0002): dual-run writeback, flags, meter, SH facade
Add dual-run flags/meter, harden task-status (idempotency, UUID, head,
push), State Hub adapter for PATCH /tasks and C-15/reconcile proxy, pilot
evidence, and finish RMGR-WP-0002.
2026-08-09 23:19:56 +02:00
|
|
|
|
- [x] Feature flags + mutation meter defined and usable
|
|
|
|
|
|
- [x] Task-status dual-run path works with RM git_sha evidence
|
|
|
|
|
|
- [x] fix-consistency can delegate reconcile for pilot set
|
|
|
|
|
|
- [x] One pilot repo runs dual-run without regression
|
|
|
|
|
|
- [x] Evidence package enables STATE-WP-0079 expansion
|
|
|
|
|
|
- [x] No scope creep into non-retirement refactors
|
2026-08-09 23:04:49 +02:00
|
|
|
|
|
|
|
|
|
|
## Residuals (only if needed at finish)
|
|
|
|
|
|
|
|
|
|
|
|
Anything not required for Stage B becomes a later WP or residual intake with
|
|
|
|
|
|
`origin: residual` — not silent backlog in SCOPE.md.
|