Problem Statement
As outlined in \ENTERPRISE_ROADMAP.md\ (Phase 1), teams adopting AI coding assistants need automated guardrails in CI/CD to prevent 'toxic AI code' from entering main branches (e.g. unverified placeholders // TODO: implement later, undeclared architectural drift, and missing test proofs).
While .github/actions/contextos-gate/action.yml\ exists, it is an internal composite action and lacks a standalone CLI command or diff-level AST / placeholder inspections.
Objective
Create a first-class \contextos gate\ command and modernize the GitHub Action to evaluate Pull Requests and enforce engineering policies before merging.
Scope of Work
- **CLI Command \contextos gate**:
- Scan git diff for prohibited lazy patterns (// TODO: implement, // ... rest of code ...).
- Verify adapter drift (
ode .agents/ctx.js export all --check).
- Run skill integrity and schema validation (
ode .agents/ctx.js validate).
- Scan for leaked credentials or secrets (\scripts/check-secrets.js).
- Run project test suites.
- GitHub Action Integration:
- Provide a GitHub Action step summary and PR annotation with pass/fail breakdown for each governance check.
- Support configuration flags (--strict, --allow-todos, --skip-tests).
Acceptance Criteria
Problem Statement
As outlined in \ENTERPRISE_ROADMAP.md\ (Phase 1), teams adopting AI coding assistants need automated guardrails in CI/CD to prevent 'toxic AI code' from entering main branches (e.g. unverified placeholders // TODO: implement later, undeclared architectural drift, and missing test proofs).
While .github/actions/contextos-gate/action.yml\ exists, it is an internal composite action and lacks a standalone CLI command or diff-level AST / placeholder inspections.
Objective
Create a first-class \contextos gate\ command and modernize the GitHub Action to evaluate Pull Requests and enforce engineering policies before merging.
Scope of Work
ode .agents/ctx.js export all --check).
ode .agents/ctx.js validate).
Acceptance Criteria
px contextos gate\ runs locally and returns non-zero exit code if prohibited patterns or drift are detected.