# Project Status — v0.4.0 → v0.5.0 Historical Record

> Archived from `.claude/rules/project-status.md` (PR #187, 2026-05-11).
> These rows represent features shipped between v0.4.0 (2026-04-21) and v0.5.0 (2026-04-29).
> Live table: [.claude/rules/project-status.md](../../../../.claude/rules/project-status.md).

## Major Changes (v0.4.0 → v0.5.0)

| Feature | Issue | Impact |
|---------|-------|--------|
| Responsibility-Driven Refactor | ADR 043 (pre-v0.5.0) | Cleans up 12 responsibility-confusion points (9 Phases). Key changes: (1) `error_mapper.py` becomes the infra ACL — domain services raise exceptions; the FastAPI handler maps them. (2) `ClassifierProtocol` + `PydanticAIClassifier` + `StubClassifier` realign the codebase with the ADR 040 pattern. (3) New `_core/infrastructure/ai/providers.py` unifies `parse_model_name` and the provider builder. (4) `AdminCrudServiceProtocol` + `extra_services_config` give admin type stability and remove the `_resolve_query_service` workaround. (5) The bootstrap conductor is decomposed into private functions. (6) `BaseEmbeddingProtocol` / `BaseVectorStoreProtocol` switch to `typing.Protocol`. (7) `src/_apps/server/testing.py` exposes the public test DI override API. |
| Quality Gate Skill Restructure | #113 | Unifies `/review-pr` / `/review-architecture` / `/security-review` into a single review flow with a shared review contract (`Scope / Sources Loaded / Findings / Drift Candidates / Next Actions / Completion State / Sync Required`). `/sync-guidelines` is documented as the closure step, supporting both review-follow-up and standalone modes. |
| Plan-feature Approach Options | #116 | Adds a Phase 1 "Approach Options" stage to the `/plan-feature` workflow (presents 2-3 candidates + trade-offs + recommendation). The existing Phase 0 (Requirements) → 1 (Architecture) → 2 (Security) → 3 (Tasks) is renumbered to 0 → 1 (Approach) → 2 (Architecture) → 3 (Security) → 4 (Tasks). |
| examples/todo + Examples Profile | #112, #119 | `examples/{name}/` mirrors the `src/{domain}/` layout exactly but is a contributor reference that does not enforce the production test baseline (factories / integration / e2e). `/review-architecture` recognises the examples profile and relaxes §5 Test Coverage (single unit test acceptable) and §2 Auth (omission acceptable). It is not subject to auto-discovery; demo via `cp -r examples/todo src/todo` followed by `make quickstart`. |
| Hybrid Harness Target Architecture | #117 (ADR 045) | Introduces a new AGENTS.md section for the 7-step Default Coding Flow (`framing → approach options → plan → implement → verify → self-review → completion gate`). The exception-token vocabulary (`[trivial]`/`[hotfix]`/`[exploration]` and bilingual aliases) escapes trivial work only. The Default Flow ranks below sandbox/approval, `.codex/rules`, safety hooks, and Absolute Prohibitions. Phase 0+1: 4 design docs (matrix / operating-model / migration-strategy + ADR) and a Default Flow Position section added to the 14×3 skill wrappers. Phase 2-5 are tracked as separate issues (UserPromptSubmit token parser / Claude PostToolUse Edit\|Write + Codex Stop changed-files / Stop completion gate / shared governor module). |
| Hybrid Harness Phase 2: UserPromptSubmit Token Parser | #121 (PR #126) | Adds an exception-token parser to the `UserPromptSubmit` hook. Detected `[trivial]`/`[hotfix]`/`[exploration]` (and bilingual aliases) prefixes write Phase 2 marker JSON files into `.claude/state/` and `.codex/state/`. Both hooks are string-equal (IC-2). Marker lifecycle is deferred to Phase 4 (#123, IC-11). |
| Hybrid Harness Phase 3: verify-first Adapters | #122 (PR #127) | Adds a verify-first informational reminder to both `PostToolUse Edit\|Write` (Claude) and the Stop hook (Codex). When a `.py` edit is followed by no verify step, the reminder is emitted to stderr (Claude) or systemMessage (Codex). Silenced by `[exploration]` (and bilingual alias) markers and verify-log freshness (`ts_epoch_ns`). Verify-log is session-isolated via `CODEX_THREAD_ID`. Strictly non-blocking (HC-3.3). Markers are read-only (IC-11). |
| Hybrid Harness Phase 4: Completion-Gate Stop Adapter | #123 (PR #128) | Adds a completion-gate to both Stop hooks. **IC-11 decision**: Option A (read-and-delete on Stop) plus a 24h defensive filter. **Pillar 7**: when changed files match Tier A/B/C in governor-paths.md, the gate emits a sync-advisory reminder; reminder model migrated from `governor-review-log/pr-{N}-*.md` to PR-description `## Governor Footer` block + `tools/check_governor_footer.py` CI (ADR 047). `completion_gate.py` is added on both sides; `stop-sync-reminder.{sh,py}` is extended (HC-4.2 single Stop entry). Strictly non-blocking (HC-4.1). |
| Hybrid Harness Phase 5: Shared Governor Module + v1 Closure | #124 (PR #130) | Governor *policy* is consolidated into a single package at [`.agents/shared/governor/`](../../../../.agents/shared/governor/), eliminating the four duplicates from Phase 2-4 (`_within_24h`, marker reader, `EXPLORATION_TOKENS`, reminder text). Claude/Codex hook scripts are rewritten as thin shims (inline policy redeclaration prohibited — IC-14). New IC-13/14/15/16 freeze. `tests/unit/agents_shared/test_governor_boundary.py` and `test_marker_lifecycle_exhaustive.py` block inline drift and GateStatus enum extensions at build time. **Hybrid Harness v1 milestone (#117) closed** — the escape-token vocabulary and dual-tool governance model are permanent (target-operating-model §3 / §7). |
| AGENT_LOCALE: Localized Hook Reminders | #133 (PR #134) | Adds `.agents/shared/governor/locale.py` (the canonical runtime source for translated hook output, 18 keys = 3 reminder + 15 sync advisory) and a `python -m governor.locale KEY` CLI invoked from `.claude/hooks/stop-sync-reminder.sh`. agent process started with `AGENT_LOCALE=ko` emits Korean; unset / `en` / unknown stays byte-identical English (IC-19 always-fallback at every emit callsite enforces). Codex `stop-sync-reminder.py` refactored into pure `build_segments` + `main` orchestrator while preserving all five existing Stop-hook responsibilities (sync advisory / verify-first / completion-gate / marker consumption / stale verify-log cleanup). The Tier 1 Language Policy exception phrasing is updated everywhere to declare two narrowly-scoped carve-outs (token vocabulary plus `LOCALE_DATA_FILES`) — synced across AGENTS.md (5 sites), CLAUDE.md, project-status.md, sync-guidelines.md, security-review.md, drift-checklist.md, `tools/check_language_policy.py` (docstring + stderr), `.pre-commit-config.yaml`. New ICs introduced: IC-18 (one-way `governor.locale → {verify, completion_gate}` import), IC-19 (always-fallback at every resolver callsite, AST-enforced), IC-20 (5-step sync for new `LOCALE_DATA_FILES` entries). 72-case `test_locale.py` covers direct API / identity / drift (AST-based, ruff implicit-concat-safe) / cycle import / CLI mode / IC-19 callsite / in-process emission / shell subprocess in temp git repo / bash 3.2 syntax. Cross-validated through 8 rounds with Codex CLI before implementation. |
| Tier 1 Language Policy + Korean Prose Cleanup | #131 (PR #132) | Adds AGENTS.md `## Language Policy` section declaring Tier 1 paths (governance / harness / contributor-facing files) as English-only prose. The bilingual escape-token vocabulary (`[trivial]`/`[hotfix]`/`[exploration]` with Korean aliases) and locale data files (`LOCALE_DATA_FILES`, added in #133) are the two narrowly-scoped exceptions, scoped per-file by `tools/check_language_policy.py`. Translates 83 Korean prose lines across 19 files; backfills 6 `governor-review-log/*` entries with 3-category provenance preservation (`> Original user/owner statement (ko, verbatim):`, `> Original reviewer verdict (ko, verbatim):`, `> Historical Korean excerpt (ko, verbatim):`). Adds 3-layer enforcement: AI behaviour rule (sync-guidelines.md Phase 0 + three review skills), pre-commit hook (`tier1-language-policy` invoking `tools/check_language_policy.py`), and CI (existing `architecture` job runs `pre-commit run --all-files`). Adds `tests/unit/agents_shared/test_language_policy.py` (11 cases including a drift test against AGENTS.md § Language Policy). Refreshes the byte-equality reminder fixtures in `test_governor_boundary.py`, `test_governor_phase3.py`, and `test_governor_phase4.py` to match the translated reminder strings. Fixes `governor-paths.md` L37 typo (`pre-commit-config.yaml` → `.pre-commit-config.yaml`) and adds `CLAUDE.md` to Tier A. Cross-validated through 5 rounds with Codex CLI before implementation. |
| OTEL Core Bootstrap | #136 | `[otel]` optional extra (opentelemetry-api/sdk/exporter-otlp-proto-grpc), `OTEL_ENABLED` + `OTEL_EXPORTER_OTLP_ENDPOINT` Settings fields, `_maybe_configure_otel()` in server + worker bootstraps, `configure_otel()` + `Agent.instrument_all()` in `_core/infrastructure/observability/otel_setup.py`, `docs/operations/observability-otel.md` recipe. ADR 046 Pillar 1 complete. |
| ADR 046: OTEL core + Langfuse opt-in + prompt domain defer | #74 (PR #135), follow-ups #136 / #137 | Re-evaluates archive/038. Three pillars: (1) `[otel]` extra (`opentelemetry-api/sdk/exporter-otlp-proto-grpc`) + `OTEL_ENABLED` + `OTEL_EXPORTER_OTLP_ENDPOINT` settings + `_maybe_configure_otel` bootstrap + Jaeger/Tempo recipe (deferred to #136). (2) `docker-compose.langfuse.yml` + `make observability-langfuse` + `docs/operations/observability-langfuse.md` opt-in recipe (deferred to #137). (3) `PromptSnapshot` value object (`src/_core/domain/value_objects/prompt_snapshot.py`) defines the consumer contract; full prompt domain deferred until non-developer editing OR 3+ simultaneous prompts. ai_usage_log gets nullable `prompt_name` / `prompt_version` (Langfuse-compatible string, labels can move) / `prompt_source` (closed vocabulary `"inline" \| "langfuse" \| "self" \| None`) / `external_prompt_ref` columns instead of `prompt_id` FK (#75). simple-chatbot uses inline `SYSTEM_PROMPT` constant with `tokens_used` in response (educational only, #97). archive/038 marked superseded. ai-infrastructure-overview.md updated with OTEL backend comparison matrix. Cross-validated through Codex review (rejected Model D — OTEL-only — for overstating what OTEL replaces). |
| Reasoning-Level Consistency Guards (Layer 2 Governor) | — (PR #143) | Adds AGENTS.md `## Reasoning-Level Consistency Guards` covering four reasoning-level miss patterns the PR-level governor (ADR 045) does not address by design: F (volatile workspace facts re-verification before consequential assertions — branch / git status / line numbers / file existence are not facts until re-verified at use time), G (every cross-review R-point closed as one of `Fixed` / `Deferred-with-rationale` / `Rejected` — `preserve` / `maintain` / `leave-as-is` are not closure categories), H (effect vs process question discrimination plus multi-round question preservation — effect questions must be answered with evidence, not substituted by process content), I (self-licensing detection before defending a challenged conclusion — premise re-verification and circular-reasoning check come before defence). Body is canonical only in AGENTS.md; `CLAUDE.md` § Claude Collaboration Rules and `.codex/hooks/session-start.py` `systemMessage` carry pointer cross-refs (visibility, not auto-loaded body). Inherited Constraints IC-RG-1 through IC-RG-5 freeze body-only-in-AGENTS, evidence-sourced guards, narrow triggers, three-category closure, and default Phase split between text rules and mechanical enforcement. Sourced from documented failure modes in a six-round cross-review (rounds 1–4 evaluation, round 5 plan review, round 6 implementation review on the PR diff itself). Phase 2 (G closure-status linter) and Phase 3 (retrospective audit) deferred to follow-up PRs. |
| Cross-Tool Prompt Template Standardisation | #144 (PR #147) | Adds canonical cross-tool review prompt templates to `/review-pr`, `/review-architecture`, `/security-review`, and `/sync-guidelines`, including original question, success metric, source list, R-point closure categories, final verdict, and sync-required fields. |
| G Closure Linter → Governor Footer CI | #145 (PR #148), ADR 047 | `tools/check_g_closure.py` (governor-review-log R-point shape linter) superseded in ADR 047 — replaced by `tools/check_governor_footer.py` + `Governor Footer Lint` GitHub Actions workflow. PR description `## Governor Footer` block is now the canonical G-closure record. |
| AI Usage Ledger | #75 (PR #149) | Adds the `ai_usage` domain, usage recording protocol, `AgentUsageRecord` / `PromptSnapshot` value objects, RDB migrations, admin and server surfaces, and coverage for usage accounting. |
| Taskiq Error Handling | #120 (PR #150) | Adds task-scoped structlog context binding, structured task failure logging, and permanent-aware smart retry middleware wired through worker bootstrap. |
