Skip to content

docs(adr): RFC-761 ADR-0001 §4 history fix + §5 phase readiness criteria#769

Merged
memtomem merged 2 commits intomainfrom
docs/rfc-761-adr-0001-phase-readiness
May 4, 2026
Merged

docs(adr): RFC-761 ADR-0001 §4 history fix + §5 phase readiness criteria#769
memtomem merged 2 commits intomainfrom
docs/rfc-761-adr-0001-phase-readiness

Conversation

@memtomem
Copy link
Copy Markdown
Owner

@memtomem memtomem commented May 4, 2026

Summary

  • Fix ADR-0001 §4 prose — Phases A (Skills), B (Commands), C (Agents)
    shipped to _PROD_ROUTERS, but the doc still claimed "web UI
    currently supports Settings Hooks sync only" (historically inverted).
  • Add new ADR-0001 §5 "Phase readiness criteria" — the four-point
    contract gating any future phase's promotion from _DEV_ONLY_ROUTERS
    to _PROD_ROUTERS and the removal of its STATE.uiMode === 'dev'
    UI gate.

Why

This is the decision-artifact PR for RFC #761 (Settings Hooks dev-only
gate → prod transition). The RFC's primary deliverable is the
stability criteria — without them, the same RFC repeats for each
future phase. The actual gate flip and Settings test backfill ship as
follow-up PRs against this contract.

The §5 criteria are:

  1. No P0/P1 issues open against the surface for ≥2 weeks.
  2. Round-trip integration test — write canonical → diff →
    import-back via extract_*_to_canonical().
  3. i18n key parity (en + ko)tests/test_i18n.py auto-discovers,
    so adding the phase's keys is sufficient.
  4. Conflict path covered by a test fixture — either HTTP 409
    (Skills' mtime_ns design) or documented soft-abort (Settings'
    200 + {"status": "aborted"}). Both shapes qualify; the
    requirement pins conflict semantics, not a specific status code.

Decisions resolved (RFC open questions)

  • Criteria home: ADR-0001 §5 (no separate ADR-0009). Existing ADR
    is the right place; cross-phase contract didn't justify a new ADR.
  • Kill-switch env var: none. ADR-0007 (Namespace CRUD promotion)
    set the precedent for trigger-criteria-then-flip with git revert
    rollback. A MEMTOMEM_WEB__CONTEXT_GATEWAY__SETTINGS_DEV_ONLY knob
    would be the first feature-level disable, breaking convention.
  • Retroactive application: §5 is prospective. Phases A–C ship
    as-is; their gaps (missing 409 fixtures in B/C) are tracked as
    hygiene follow-ups, not regressions.
  • Conflict-path criterion chore: drop packages/memtomem-stm from monorepo (Phase 3b) #4 wording: status-code agnostic. The
    earlier "409 conflict" wording would have flagged Settings itself
    (which uses 200 + status:"aborted" by design) and Phases B/C
    retroactively. Both 409 and documented soft-abort qualify now.

Out of scope (follow-up PRs)

This PR is docs-only — no code changes. Two follow-up PRs land the
behavior:

  • PR-2 (gap-fill): add test_settings_round_trip_* and
    test_settings_conflict_aborts_with_status to
    tests/test_context_settings.py, plus the ctx_settings.*
    navigation i18n keys to en.json + ko.json.
  • PR-3 (the flip): move settings_sync from _DEV_ONLY_ROUTERS
    to _PROD_ROUTERS in web/app.py, drop the two
    STATE.uiMode === 'dev' gates in web/static/context-gateway.js,
    CHANGELOG entry.

Phases B/C 409 backfill is filed as a separate hygiene issue (not
blocking).

Test plan

  • Read ADR-0001 end-to-end; §3 → §4 → §5 → Consequences flow is
    coherent and the §4 prose is no longer historically inverted.
  • §5 criteria each cite a concrete file or shape (no abstractions
    that drift).
  • CI ruff/mypy/pytest jobs unaffected (docs-only diff, no source
    modifications).

Refs: #761

🤖 Generated with Claude Code

pandas-studio and others added 2 commits May 4, 2026 22:56
ADR-0001 §4 was authored when Settings Hooks was the only web UI sync
surface. Phases A (Skills), B (Commands), C (Agents) have since shipped
to _PROD_ROUTERS while Settings remains in _DEV_ONLY_ROUTERS — so the
"web UI currently supports Settings Hooks sync only" prose is now
historically inverted.

Update §4 to reflect that A–C shipped and Settings (Phase D) is the
remaining dev-only surface awaiting promotion.

Add new §5 "Phase readiness criteria" — the four-point contract that
gates any phase's promotion from _DEV_ONLY_ROUTERS to _PROD_ROUTERS
(and removal of its STATE.uiMode === 'dev' UI gate):

1. No P0/P1 issues open ≥2 weeks
2. Round-trip integration test (write → diff → import-back)
3. i18n key parity (en + ko, via test_i18n.py auto-discovery)
4. Conflict path test fixture (HTTP 409 OR documented soft-abort)

§5 applies prospectively. Phases A–C ship as-is; gaps in their tests
(e.g., missing 409 fixtures in B/C) are tracked as hygiene follow-ups,
not regressions blocking re-merge.

Procedure mirrors ADR-0007 (Namespace CRUD prod exposure): no env
kill-switch; rollback via 'git revert' of the gate-removal commit.

This is the decision-artifact PR for RFC #761; the Settings test
backfill (round-trip + conflict-aborts + ctx_settings i18n nav keys)
and the actual flip (router move + JS gate removal) ship as separate
PRs against this contract.

Refs: #761

Co-Authored-By: Claude <[email protected]>
Two refinements based on review feedback:

**Criterion 2** — phase-shape aware. The previous wording required
import-back via extract_*_to_canonical() for every phase, but Phase D
Settings is unidirectional by design: canonical → runtime additive
merge has no reverse-import API because merged entries cannot be
distinguished from user-authored entries in ~/.claude/settings.json.
Forcing reverse-import would self-block the very PR-3 §5 is meant to
enable.

Split into bidirectional (Skills/Commands/Agents — extract-back) and
unidirectional (Settings — sync route + diff re-read with merge
invariant assertion).

**Criterion 1** — drop the specific gh command. The original
'gh issue list --label context-gateway,P0,P1' had two flaws:

1. --label A,B,C filters AND, not OR; a P0-only or P1-only issue
   could be missed.
2. The labels (context-gateway, P0, P1) are not a fixed convention in
   this repo today.

Replace with a label-agnostic phase-scope description so the criterion
remains accurate as labeling conventions evolve.

Refs: #761

Co-Authored-By: Claude <[email protected]>
@memtomem memtomem merged commit f4924db into main May 4, 2026
11 checks passed
@memtomem memtomem deleted the docs/rfc-761-adr-0001-phase-readiness branch May 4, 2026 14:12
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants