Skip to content

feat(ci): add p0-gate workflow and runbook baseline - #172

Merged
bouillipx merged 3 commits into
mainfrom
codex/p0-conformance-gate
Mar 3, 2026
Merged

feat(ci): add p0-gate workflow and runbook baseline#172
bouillipx merged 3 commits into
mainfrom
codex/p0-conformance-gate

Conversation

@bouillipx

Copy link
Copy Markdown
Collaborator

Summary

This PR advances the active p0-conformance-gate change to the repository-controlled finish line.

Included here:

  • add the missing integration anchors for all three P0 categories
  • add scripts/ci/p0_gate.py as the single gate entrypoint
  • add CI-side unit coverage for the summary/triage contract
  • wire a new p0-gate job into .github/workflows/ci-gate.yml
  • add docs/guides/P0_Gate_Runbook.md for local usage, release archival, and flaky handling
  • sync OpenSpec tasks, governance docs, and feature evidence

Why

Before this PR, p0-conformance-gate had a frozen category matrix but still lacked:

  • a full integration anchor for step_driven
  • a runtime-backed integration anchor for SQLite event-log replay/hash-chain validation
  • a single deterministic CI/local command entrypoint
  • a stable summary contract for category-tagged triage
  • an operational runbook for local execution, release evidence archival, and flaky handling

This PR closes the repository-side gap. The only remaining open task in the change is the external repo-admin action that marks p0-gate as a required protected-branch check.

Scope

Included:

  • tests/integration/test_p0_conformance_gate.py
  • tests/unit/test_p0_gate_ci.py
  • scripts/ci/p0_gate.py
  • .github/workflows/ci-gate.yml
  • docs/guides/P0_Gate_Runbook.md
  • docs/governance/branch-protection.md
  • docs/guides/Team_Agent_Collab_Playbook.md
  • docs/README.md
  • openspec/changes/p0-conformance-gate/*
  • docs/features/p0-conformance-gate.md

Not included:

  • GitHub branch protection / ruleset mutation for required checks
  • change archive / closeout

TODO / Change Mapping

  • Change: p0-conformance-gate
  • Completed in this PR:
    • 2.1 security integration anchor
    • 2.2 step-driven integration anchor
    • 2.3 audit-chain integration anchor
    • 3.1 CI workflow entrypoint
    • 3.3 deterministic summary contract
    • 4.1 local run + troubleshooting docs
    • 4.2 release archive guidance
    • 4.3 flaky handling rules
  • Still open after this PR:
    • 3.2 add p0-gate as a required branch protection check (repo-admin follow-up)

Validation

Executed:

  • ../../.venv/bin/python -m pytest -q tests/integration/test_security_policy_gate_flow.py tests/integration/test_p0_conformance_gate.py tests/unit/test_dare_agent_step_driven_mode.py
  • ../../.venv/bin/python -m pytest -q tests/unit/test_dare_agent_security_policy_gate.py tests/unit/test_dare_agent_security_boundary.py tests/unit/test_five_layer_agent.py
  • ../../.venv/bin/python -m pytest -q tests/unit/test_p0_gate_ci.py
  • ../../.venv/bin/python scripts/ci/p0_gate.py
  • openspec validate p0-conformance-gate --type change --strict --json --no-interactive
  • ./scripts/ci/check_governance_evidence_truth.sh

Results:

  • category integration bundle passes locally
  • p0-gate emits the expected PASS summary
  • OpenSpec validation passes with 0 issues
  • governance evidence gate passes

Review Focus

Please focus on:

  1. whether the p0-gate category bundle matches the frozen scope matrix
  2. whether the summary contract is specific enough for triage without being overly noisy
  3. whether the runbook/archive/flaky rules are strict enough for blocker-grade gate semantics
  4. whether anything in this PR accidentally implies task 3.2 is already complete

Complete the repository-controlled portion of the active p0-conformance-gate change.

Key changes:
- add integration anchors for step-driven closed-loop execution and runtime-backed SQLite event-log replay/hash-chain verification
- add scripts/ci/p0_gate.py as the single deterministic CI/local command entrypoint for SECURITY_REGRESSION, STEP_EXEC_REGRESSION, and AUDIT_CHAIN_REGRESSION
- add unit coverage for p0-gate summary formatting and failed-node extraction
- wire a new p0-gate job into .github/workflows/ci-gate.yml
- add docs/guides/P0_Gate_Runbook.md covering local execution, category triage, release archive requirements, and flaky-handling rules
- update branch-protection, Team Agent playbook, docs navigation, OpenSpec tasks/spec evidence, and feature evidence

Rationale:
The change originally lacked explicit integration anchors for the full P0 category bundle and had no single CI command or operational guidance for the gate. This commit freezes the repository-side behavior and documentation so the only remaining open task is the external repo-admin branch protection step that marks p0-gate as a required check on main.

Verification:
- ../../.venv/bin/python -m pytest -q tests/integration/test_security_policy_gate_flow.py tests/integration/test_p0_conformance_gate.py tests/unit/test_dare_agent_step_driven_mode.py
- ../../.venv/bin/python -m pytest -q tests/unit/test_dare_agent_security_policy_gate.py tests/unit/test_dare_agent_security_boundary.py tests/unit/test_five_layer_agent.py
- ../../.venv/bin/python -m pytest -q tests/unit/test_p0_gate_ci.py
- ../../.venv/bin/python scripts/ci/p0_gate.py
- openspec validate p0-conformance-gate --type change --strict --json --no-interactive
- ./scripts/ci/check_governance_evidence_truth.sh
Update the active p0-conformance-gate feature aggregation doc with the implementation PR link and current review status.

Key changes:
- add PR #172 under review and merge gate links
- replace the stale 'not opened yet' status with the live implementation PR state

Rationale:
The feature aggregation doc is the evidence source of truth for the active change. Once the implementation PR exists, the review/merge gate section must point to it so governance and reviewer workflows stay auditable.

Verification:
- ./scripts/ci/check_governance_evidence_truth.sh
@bouillipx

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c31e6c8cce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/ci/p0_gate.py Outdated
Address the PR #172 review item about missing node ids when pytest fails with ERROR summary lines.

Key changes:
- extend scripts/ci/p0_gate.py failure extraction so both FAILED and ERROR summary rows produce deterministic node ids
- add unit coverage for ERROR-line extraction in tests/unit/test_p0_gate_ci.py
- refresh the active p0-conformance-gate feature evidence to record the review fix and updated unit test count

Rationale:
The previous implementation only captured assertion-style FAILED lines. Collection/import/runtime failures would therefore degrade CI triage to '<no failing test ids captured>', which weakens the summary contract for blocker-grade gate handling.

Verification:
- ../../.venv/bin/python -m pytest -q tests/unit/test_p0_gate_ci.py
- ../../.venv/bin/python scripts/ci/p0_gate.py
- ./scripts/ci/check_governance_evidence_truth.sh

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27bf193f47

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/ci/p0_gate.py
from dataclasses import dataclass
from pathlib import Path

FAILED_TEST_RE = re.compile(r"^(?:FAILED|ERROR)\s+([^\s]+)")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict ERROR matching to pytest summary lines

extract_failed_tests currently treats any line that starts with ERROR as a failing node id, so failure output that includes captured error logs (for example ERROR root:test_file.py:4 ...) is parsed as if root:test_file.py:4 were a test id. This produces incorrect triage entries in the p0-gate summary whenever a failing test logs at ERROR level, which undermines the deterministic failure-pointer contract even though the gate pass/fail status is correct.

Useful? React with 👍 / 👎.

@bouillipx
bouillipx merged commit f22b786 into main Mar 3, 2026
9 checks passed
@bouillipx
bouillipx deleted the codex/p0-conformance-gate branch March 3, 2026 13:02
mindfn added a commit that referenced this pull request Mar 6, 2026
Fix the newly failing governance intent gate and the latest review comment on checkpoint defaults.

Changes:
- rewrite dare_framework/checkpoint/defaults.py to remove imports from deleted checkpoint._internal modules
- provide in-module legacy-compatible checkpoint symbols so the defaults facade remains importable
- add regression test tests/unit/test_checkpoint_defaults.py to lock importable default exports
- add missing Intent PR link to docs/features/p0-conformance-gate.md so governance-intent-gate can validate merged intent metadata for active governed docs

Verification:
- ../../.venv/bin/python -m pytest -q tests/unit/test_checkpoint_defaults.py (passed)
- GOVERNANCE_INTENT_GATE_DIFF_RANGE='origin/main...HEAD' GOVERNANCE_INTENT_GATE_PR_STATE_FIXTURE='#126=merged,#172=merged' ./scripts/ci/check_governance_intent_gate.sh (passed)
- ./scripts/ci/check_governance_traceability.sh (passed)
- ./scripts/ci/check_governance_evidence_truth.sh (passed)
- openspec validate p0-conformance-gate --type change --strict --json --no-interactive (valid)
mindfn added a commit that referenced this pull request Mar 6, 2026
…ation

Address the latest PR #188 review comment on SessionContextContributor config loss.

Root cause:
- SessionContextContributor.serialize() called asdict(session_context) and then attempted asdict(serialized['config']) again.
- For dataclass-backed contexts, the first asdict() already converted config to dict, so the second call raised and forced config to None.

Changes:
- only run asdict() for config when config is non-null and not already a dict
- keep existing dict config payload untouched
- extend tests/unit/test_checkpoint_defaults.py with a regression test that verifies config survives serialization

Verification:
- ../../.venv/bin/python -m pytest -q tests/unit/test_checkpoint_defaults.py (2 passed)
- GOVERNANCE_INTENT_GATE_DIFF_RANGE='origin/main...HEAD' GOVERNANCE_INTENT_GATE_PR_STATE_FIXTURE='#126=merged,#172=merged' ./scripts/ci/check_governance_intent_gate.sh (passed)
- ./scripts/ci/check_governance_traceability.sh (passed)
- ./scripts/ci/check_governance_evidence_truth.sh (passed)
mindfn added a commit that referenced this pull request Mar 6, 2026
Address the latest review comment on selector-overlap coverage in scripts/ci/check_test_failure_ownership.py.

Root cause:
- overlap detection only tokenized selectors by
- directory selectors like  were treated as unrelated to descendant node selectors such as
- this allowed cross-category ownership overlap to bypass validation

Changes:
- normalize selectors into path parts + pytest node parts
- treat file_or_dir path prefix matches as overlapping when the prefix side has no node suffix
- keep existing node-level overlap and parametrized node normalization behavior
- add regression test for directory selector overlap in tests/unit/test_check_test_failure_ownership.py

Verification:
- ../../.venv/bin/python -m pytest -q tests/unit/test_check_test_failure_ownership.py (5 passed)
- ../../.venv/bin/python scripts/ci/check_test_failure_ownership.py (passed)
- ../../.venv/bin/python scripts/ci/p0_gate.py (PASS)
- GOVERNANCE_INTENT_GATE_DIFF_RANGE='origin/main...HEAD' GOVERNANCE_INTENT_GATE_PR_STATE_FIXTURE='#126=merged,#172=merged' ./scripts/ci/check_governance_intent_gate.sh (passed)
- ./scripts/ci/check_governance_traceability.sh (passed)
- ./scripts/ci/check_governance_evidence_truth.sh (passed)
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