Skip to content

fix(governance): make the checkpoint regressions state-independent (WO-024-P-G1-C2) - #99

Merged
KayzenRoot merged 1 commit into
mainfrom
governance/wo024-p-g1-c2-stateful-test-correction
Sep 17, 2026
Merged

KayzenRoot merged 1 commit into
mainfrom
governance/wo024-p-g1-c2-stateful-test-correction

Conversation

@KayzenRoot

Copy link
Copy Markdown
Owner

Revisão do executor - WO-024-P-G1-C2 (correção dos testes stateful)

1. Resumo

Correção mínima, test-only e auto-hospedada, que remove o último bloqueio objetivo do
WO-024-P: as duas regressões de checkpoint passam a ser independentes do estado físico da
árvore de trabalho e funcionam tanto no estado pré-promoção quanto no estado final promovido.
Nenhum guard foi afrouxado, nenhum caminho canônico foi tocado e o par de promoção ativo
permanece exatamente {WO-024-G1, WO-024-P}. O PR #98 e os arquivos canônicos não foram
alterados.

2. As duas falhas e a correção

O incremento anterior (WO-024-P-G1-C1) acrescentou regressões que liam o checkpoint da árvore
de trabalho
como base da promoção:

  • test_checkpoint_current_accepts_both_legitimate_states entregava a árvore viva a
    require_wo024p_checkpoint_semantics; na árvore promovida a mesma árvore já é o checkpoint
    final, e o contrato corretamente rejeita
    (WO-024-P promotion base must contain exactly the remaining closure pending items).
  • test_checkpoint_current_fails_closed_on_malformed_or_stale_states construía o caso negativo
    removendo - stabilization. da árvore viva; após a promoção a remoção era inócua e a variante
    coincidia com o checkpoint promovido válido (('active status without pending items', 'PASS')).

Correção aplicada (somente testes):

  1. synthesized_checkpoint_pair() constrói, de forma determinística e a partir das expectativas
    do próprio contrato, um checkpoint pré-promoção e o seu sucessor promovido,
    independentemente do estado da árvore. O checkpoint vivo nunca é usado como base de promoção,
    e o checkpoint promovido nunca é apresentado ao contrato como base.
  2. O caso negativo "sem itens pendentes" agora deriva da fixture pré-promoção e a mutação
    realmente remove um item pendente: a matriz verifica isso explicitamente
    (assert without_one_pending != base_text e o item não permanece no texto), rejeitando
    qualquer substituição no-op.
  3. Casos negativos preservados e derivados da fixture: unknown status, pending residual no estado
    promovido, seção canônica ausente, next step obsoleto, checkpoint vazio e estado ativo
    incompleto — todos continuam FAIL/UNKNOWN, e nenhum pode virar PASS.
  4. Nova regressão test_checkpoint_regressions_hold_with_a_promoted_working_tree executa a
    asserção de contrato, o verificador nos dois estados e toda a matriz negativa com
    document_text retornando o estado promovido, provando que os testes valem nos dois
    estados legítimos.

require_wo024p_checkpoint_semantics, checkpoint_current() e todos os guards fail-closed de
produção/governança permanecem intactos (nenhuma linha de scripts/v01_closure_sprint.py foi
tocada).

3. Prova de independência de estado

Cenário Resultado
pytest backend/tests/test_v01_closure_sprint.py com a árvore pré-promoção (estado atual da main) 17 passed
Mesmo arquivo com a árvore contendo o checkpoint promovido (f7b5ab74…, restaurado depois) 17 passed
pytest backend/tests/test_review_evidence.py na árvore promovida 254 passed
Contrato estrito sobre o par sintetizado PASS
checkpoint_current() na base sintetizada, no promovido sintetizado e na árvore viva PASS
Matriz negativa (7 casos) nos dois estados FAIL/UNKNOWN, nunca PASS

4. Governança auto-hospedada

WO-024-P-G1-C2 foi registrado em scripts/review_evidence.py com base exata
a5cc341375a0cc067edc52db4ff2dc36b66a8c00 e allowlist fechada (backend/tests/test_review_evidence.py,
backend/tests/test_v01_closure_sprint.py, scripts/review_evidence.py). O contrato do corretivo
exige: branch base main, exatamente um marcador HIVE-AUTHORIZED-BASE igual à base, delta não
vazio, nenhum caminho fora do allowlist, nenhum arquivo de promoção canônica, nenhum
Project Brain/canônico, nenhuma migration/workflow/dependency/release, par de promoção ativo
inalterado e auto-merge UNARMED. A evidência textual emitida registra explicitamente:
checkpoint_regressions_state_independent=True, live_checkpoint_never_a_promotion_base=True,
no_op_negative_fixture_rejected=True,
guards_unchanged=require_wo024p_checkpoint_semantics,checkpoint_current,
active_promotion_pair_unchanged=True, corrective_outside_active_pair=True,
v0.1_promotion_performed=False, v0.1_completion_claim=False.

Regressões adicionadas em backend/tests/test_review_evidence.py: work order suportado no base
exato; base errada rejeitada; delta vazio e caminho extra rejeitados; tentativa de incluir o par
canônico de promoção rejeitada; marcador ausente/duplicado/malformado rejeitado; work order
desconhecido continua fail-closed; texto de evidência de governance emitido com os fatos de
não-promoção.

5. Arquivos alterados

Arquivo Motivo
backend/tests/test_v01_closure_sprint.py fixture sintetizada e regressões state-independent
backend/tests/test_review_evidence.py regressões de auto-hospedagem do corretivo
scripts/review_evidence.py registro do work order corretivo, escopo fechado e evidência de governance

Exatamente os três caminhos do allowlist; nenhum quarto arquivo foi necessário (generate_maps.py --check passou sem regeneração). Nenhum arquivo canônico, de produto, workflow, dependência, migration ou release foi tocado.

6. Testes e resultados

Comando Resultado
python -m pytest backend/tests/test_v01_closure_sprint.py -q 17 passed (nos dois estados da árvore)
python -m pytest backend/tests/test_review_evidence.py -q 257 passed
python scripts/verify_canonical_sources.py PASS (17 arquivos)
python scripts/generate_maps.py --check exit 0
python scripts/check_secrets.py PASS (211 arquivos)
python -m ruff format --check / ruff check . 90 arquivos formatados / All checks passed
python -m mypy Success, 61 arquivos
python scripts/validate.py exit 0 — backend 704 passed / 5 skipped, dashboard 34 passed, todos os status PASS

7. Identidade e estado

  • Branch: governance/wo024-p-g1-c2-stateful-test-correction (criada da main exata, não da branch do PR docs(project-brain): promote the final V0.1 closure checkpoint (WO-024-P) #98).
  • Base / authorized base: a5cc341375a0cc067edc52db4ff2dc36b66a8c00.
  • HEAD exato: fa43b33a5cfb6b5b25b85a5da9f0c129d0e2ea3e.
  • Marcadores: exatamente um HIVE-WORK-ORDER: WO-024-P-G1-C2 e um HIVE-AUTHORIZED-BASE exato.
  • PR docs(project-brain): promote the final V0.1 closure checkpoint (WO-024-P) #98: intocado — aberto, Ready, HEAD 103d1fe46c3ff589fb69854fd4626153c8487835, mesma branch, mesmo diff canônico de dois arquivos.
  • Arquivos canônicos (13-CHECKPOINT.md, CANONICAL-SHA256SUMS.txt): não alterados neste incremento.
  • Ruleset 21934284: ativo e inalterado (squash-only, zero bypass); auto-merge UNARMED; sem merge, tag ou release; nenhum trabalho pós-V0.1 iniciado.

8. Riscos pendentes

  • Após o merge deste corretivo, o PR docs(project-brain): promote the final V0.1 closure checkpoint (WO-024-P) #98 precisa ser atualizado (rebase/refresh) sobre o novo main e revalidado nos três gates — a execução do WO-024-P em si continua sendo o próximo passo autorizado pelo Sol.
  • Achado secundário ainda aberto (não é deste escopo): documentation_currentness_entry() não é usado para produzir documentation_entries da evidência de closure, que hoje se auto-afirmam PASS guardadas apenas por existência de arquivo; a entrada deployment falharia com o verificador real (12-LOCAL-DEPLOYMENT.md não contém HIVE_DATA_ROOT).

Update de checkpoint proposto: NONE — este incremento não promove V0.1 e não altera o checkpoint.

…O-024-P-G1-C2)

The two checkpoint regressions added by WO-024-P-G1-C1 read the working-tree
checkpoint as the promotion base, so they could not pass once the tree holds the
promoted checkpoint that WO-024-P produces. That made Validate unreachable for
the final promotion (hosted run 35234129663: 2 failed, 703 passed).

Both regressions now synthesize a pre-promotion checkpoint and its promoted
successor from the contract's own expectations, deterministically and separately
from the live checkpoint:

- the promotion base is never the live (possibly promoted) checkpoint, and the
  promoted checkpoint is never presented to the contract as that base;
- the no-op negative fixture is rejected: the "active status without pending
  items" case must actually remove a pending item, and the matrix asserts it did;
- negatives preserved: unknown status, residual pending in the promoted state,
  missing canonical section, stale next step, empty checkpoint and an incomplete
  active state all stay FAIL/UNKNOWN;
- a new regression runs the whole matrix with document_text returning the
  promoted state, proving the tests hold in either legitimate tree state.

No guard was loosened: require_wo024p_checkpoint_semantics and
checkpoint_current() are untouched, and the patch changes no production path.

WO-024-P-G1-C2 is self-hosted as a separate bounded corrective work order: exact
base, closed allowlist, single authorized-base marker, no canonical/migration/
workflow/dependency/release delta, auto-merge unarmed, and explicitly outside the
active promotion pair {WO-024-G1, WO-024-P}.
@github-actions

Copy link
Copy Markdown

HIVE Review Evidence — WO-024-P-G1-C2

  • Work Order: WO-024-P-G1-C2
  • Exact HEAD SHA: fa43b33a5cfb6b5b25b85a5da9f0c129d0e2ea3e
  • Base SHA: a5cc341375a0cc067edc52db4ff2dc36b66a8c00
  • PR state: READY
  • Changed files: 3backend/tests/test_review_evidence.py, backend/tests/test_v01_closure_sprint.py, scripts/review_evidence.py
  • Canonical changes: project_brain_changed False, checkpoint_changed False, authorized paths none
  • Validate result: PASS
  • Integration health result: PASS
  • Review Evidence result: PASS
  • Migration head: 0007_telemetry_events
  • Backend tests: 709 passed, 0 failed, 0 skipped
  • Dashboard tests: 0 passed, 0 failed
  • Integration summary: Project Registry PASS, Task Intake/CAS PASS, Repository Indexing PASS, Retrieval PASS, Redis restart PASS, API restart PASS, Reranking PASS, Context Manager PASS
  • Git race-integrity tests: HEAD True, inventory True, prior corpus preserved True
  • Duplicate task candidate tests: collapsed True, task provenance preserved True, cross-project isolation True
  • Benchmark summary: PASS; query count 4, recall@1 1.0, recall@5 1.0, MRR 1.0, critical misses 0, two-run reproducibility True
  • Semantic benchmark: PASS; recall@5 1.0, MRR 1.0, critical misses 0, two-run reproducibility True
  • Hybrid benchmark: PASS; recall@5 1.0, MRR 1.0, RRF gate True
  • Reranking benchmark: PASS; recall@5 1.0 vs hybrid 1.0, MRR 1.0 vs 0.2, strict improvement True, pool bounded True, provenance True
  • Reranking C1 integration safety: project isolation True, duplicate TASK collapse True, cross-project duplicate isolation True, malformed-response matrix True, semantic STALE preservation True, secret non-leak True, ordering reproducible True, run 1 digest e89462563e768d3a68ae07ea4e5ab8d7b8dda18e7cb9ce25a3ff5ba2e3c3346c, run 2 digest e89462563e768d3a68ae07ea4e5ab8d7b8dda18e7cb9ce25a3ff5ba2e3c3346c
  • Semantic integrity: pgvector vector, dimensions 8, reuse without provider calls 0
  • Canonical verifier: PASS
  • Secret scan: PASS
  • Known warnings: 2 recorded
    • Redis host warning observed: vm.overcommit_memory is disabled.
    • npm dependency deprecation warning observed.
  • Ruleset: 21934284 / Protect main; enforcement active; required contexts Integration health, Review Evidence, Validate; thread resolution True; merge methods squash; bypass actors 0
  • Ruleset unchanged: True
  • Repository merge settings: squash True, merge commit True, rebase False, delete head branch True, automatic merge True
  • Auto-merge armed: False / none
  • Auto-merge owner: none (unknown); user-owned: False
  • Context Manager evidence: PASS; checkpoint first True, mandatory coverage True, kind sequence ['CHECKPOINT', 'SCOPE', 'DEFINITION_OF_DONE', 'ARCHITECTURE', 'DECISIONS'], project-scoped True, task-scoped True, reranked True, bounded True, deterministic two-run True, LLM calls 0
  • Context Fingerprint evidence: PASS; valid hit True, work avoided True, source/task/request invalidation True/True/True, cross-project True, corrupt-cache rebuild True, Redis loss True, equivalent rebuild True, transient-not-cached/recovery-retried True/True, LLM/provider calls 0/0
  • Delta Context evidence: PASS; implemented True, identical/change/dependency True/True/True, reconstruction/fingerprint True/True, false reconstructions/critical misses 0/0, LLM/provider calls 0/0, final stability/post-build race True/True, valid not-smaller baseline/reason True/True, final delivery bound True, estimate contract/final estimate/strict gate True/True/True, metadata false-positive/savings truthful True/True
  • Provider/Prompt Cache evidence: PASS; canonical provider-canonical-input-v1, independent composition True, mutation fixtures/detected/accepted 5/5/0, provider identity fixture True, credential rotation/leaks True/0, cross-project leaks 0, requested/no-receipt/zero/repeat/positive True/True/True/True, false hits 0, invalid accounting accepted 0, FULL/DELTA measured True/True, Delta false/misses 0/0, LLM/provider calls 0/0
  • Memory Lifecycle evidence: PASS; PostgreSQL durable True, Redis noncanonical True, project-scoped True, cross-project rejection True, provenance True, staged model output True, qualified promotion True, history True, restart/Redis loss True/True, secret leaks 0, immutable Git blob True, source/ADR/HEAD race rejection True/True/True, race atomicity True, generic decision True, identity True
  • ACCE Storage Policy evidence: UNKNOWN; version UNKNOWN, policy UNKNOWN, HOT/WARM/COLD False, benchmark rows 0, logical/physical measured False/False, dedup truthful False, canonical loss UNKNOWN, LLM/provider calls UNKNOWN/UNKNOWN
  • MCP Core Surface evidence: UNKNOWN; version UNKNOWN, file UNKNOWN, tools [], real transport False, direct Core False, isolation False, checkpoint first False, restart/Redis loss False/False, leaks UNKNOWN/UNKNOWN, calls UNKNOWN/UNKNOWN, projects UNKNOWN, arbitrary filesystem rejection False, checkpoint missing/untracked/stale/substitution False/False/False/False, context provenance/bounds False/False, memory provenance/status False/False/False, errors structured/bounded False/False
  • Telemetry/Event Bus evidence: NOT_REQUIRED; version NOT_REQUIRED, events [], PostgreSQL durable/Redis noncanonical False/False, replay/stream/reconnect False/False/False, leaks secret/path/cross-project UNKNOWN/UNKNOWN/UNKNOWN, LLM/provider calls UNKNOWN/UNKNOWN
  • Control Center Metrics evidence: NOT_REQUIRED; version NOT_REQUIRED, families [], provenance [], history max UNKNOWN, token/context/cache/storage bounds False/False/False/False, PostgreSQL/Redis canonicality False/False, cost UNKNOWN, leaks/calls UNKNOWN/UNKNOWN/UNKNOWN/UNKNOWN/UNKNOWN
  • Full Control Center evidence: NOT_REQUIRED; version NOT_REQUIRED, project capabilities [], charts [], alerts [], health [], full V0.1 claim False, leaks/calls UNKNOWN/UNKNOWN/UNKNOWN/UNKNOWN/UNKNOWN
  • V0.1 Closure Sprint evidence: NOT_REQUIRED; version NOT_REQUIRED, closure candidate False, dod matrix UNKNOWN/UNKNOWN, fail UNKNOWN, unknown UNKNOWN, remaining HIGH/CRITICAL UNKNOWN/UNKNOWN, leaks/calls UNKNOWN/UNKNOWN/UNKNOWN/UNKNOWN/UNKNOWN
  • WO-014-C2 governance evidence: NOT_RECORDED
  • WO-014-P-G1 governance evidence: NOT_RECORDED
  • WO-015-G1 governance evidence: NOT_RECORDED
  • WO-015-P-G1 governance evidence: NOT_RECORDED
  • WO-016-P-G1 governance evidence: NOT_RECORDED
  • WO-016-P governance evidence: NOT_RECORDED
  • WO-017-G1 governance evidence: NOT_RECORDED
  • WO-017 governance evidence: NOT_RECORDED
  • WO-017-P-G1 governance evidence: NOT_RECORDED
  • WO-017-P governance evidence: NOT_RECORDED
  • Progressive Disclosure evidence: mapping True, smallest sufficient True, no unnecessary escalation True, explicit insufficiency True, bounded True, stop-on-sufficient True, cross-project disclosure True, disclosure LLM calls 0, adaptive token budget True, C1 acceptance True, C1 L1/L2 True/True, C1 L4 nonempty True, C1 explicit level True, C2 L4 full file True/True, C2 L4 oversize fail-closed True
  • Required independent approvals: 0; independent approvals observed: 0
  • Consolidated artifact: hive-review-evidence-WO-024-P-G1-C2-fa43b33a5cfb6b5b25b85a5da9f0c129d0e2ea3e
  • Workflow run URL: https://github.com/KayzenRoot/hive/actions/runs/35237840264

Sol Review State: AWAITING_SOL

Workflow run: https://github.com/KayzenRoot/hive/actions/runs/35237840264

@KayzenRoot KayzenRoot left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOL FINAL AUDIT

VERDICT: APPROVED

Audited exact HEAD: fa43b33
Authorized base: a5cc341
Work order: WO-024-P-G1-C2

Scope is bounded to exactly 3 authorized governance/test paths. No canonical Project Brain, product, migration, dependency, workflow, ruleset or release path changed. The stateful checkpoint regressions are now independent of the physical working-tree checkpoint, no-op negative mutation is rejected, and strict promotion/checkpoint guards remain unchanged.

Hosted exact-head evidence, run 35237840264:

  • Validate: PASS
  • Integration health: PASS
  • Review Evidence: PASS
  • backend: 709 passed, 0 failed
  • dashboard: 34 passed
  • canonical verifier: 17 PASS
  • secret scan: 211 PASS
  • ruff/mypy/dashboard lint/typecheck/build/docker compose: PASS

Pre-merge governance rechecked: Ready, mergeable clean, main unchanged at authorized base, ruleset 21934284 active/strict/squash-only/zero bypass, zero unresolved threads, auto-merge UNARMED.

Secondary documentation-currentness evidence-field inconsistency is acknowledged as IMPORTANT follow-up but is nonblocking for this corrective increment because canonical DoD rows and closure_candidate use their own deterministic documentation/deployment verifiers. It must not expand this PR.

APPROVED FOR EXACT-HEAD SQUASH under HIVE-ADR-019.

@KayzenRoot
KayzenRoot merged commit 0df7bb1 into main Sep 17, 2026
3 checks passed
@KayzenRoot
KayzenRoot deleted the governance/wo024-p-g1-c2-stateful-test-correction branch September 17, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant