Skip to content

ci: add 5 missing local_pr_pipeline scripts referenced by pr-pipeline.yml#129

Open
cryptoxdog wants to merge 2 commits into
mainfrom
cursor/pipeline-scripts-20d4
Open

ci: add 5 missing local_pr_pipeline scripts referenced by pr-pipeline.yml#129
cryptoxdog wants to merge 2 commits into
mainfrom
cursor/pipeline-scripts-20d4

Conversation

@cryptoxdog

Copy link
Copy Markdown
Collaborator

Summary

.github/workflows/pr-pipeline.yml references five scripts under local_pr_pipeline/ that were never committed to the repo (confirmed absent from all branches' history). As a result the compliance, l9, and docs jobs failed unconditionally on every PR — gate defects unrelated to any code change.

This adds functional implementations, each with an # L9_META header and matching the style of the existing local_pr_pipeline/compliance_kb_validate.py.

Scripts

Script Job step Behavior
check_compliance_terminology.py compliance → Terminology Guard AST-based; fails if app/ code imports the deprecated chassis.envelope/router/registry dispatch modules (C-21 / ARCH-003). Prose mentions in docs are never flagged.
docs_link_check_local.py docs → markdown link check Validates relative markdown links. Defaults to root governance docs; supports explicit paths and --all for the whole tree.
docs_consistency_local.sh docs → consistency checks Runs doc-presence check + KB validation + link check; non-zero on any failure.
run_pr_select_gates.py l9 → Select and run gates Reads gates.json from l9_contract_control.py select-gates and runs each selected command, reporting all failures.
contract_bound_local.py l9 → Contract-bound change gate Thin CLI over scripts.l9_contract_control.build_review_signal; flags contract-bound changes lacking required companion updates.

Design notes

  • The link checker defaults to root-level governance docs (which are clean on main) rather than the whole tree, since the repo has pre-existing broken links in reports/ and docs/ that are out of scope here; --all is available for a full sweep.
  • run_pr_select_gates.py and contract_bound_local.py delegate to the existing scripts/l9_contract_control.py so the gate/policy logic stays single-sourced.

Verification (on main content)

  • Terminology guard: 134 app/ files checked, no deprecated dispatch → pass.
  • Link check: 6 root docs, 0 broken → pass.
  • Docs consistency: all 3 sub-checks pass.
  • select-gatesrun_pr_select_gates.py: correctly runs selected commands / no-ops on empty selection.
  • contract_bound_local.py: exit 0 for clean/no-contract-bound cases, exit 1 for contract-bound-without-companion.
  • ruff check + ruff format --check clean.

Scope / tier

New CI tooling under local_pr_pipeline/ (T2). No production code changes.

Open in Web Open in Cursor 

….yml

pr-pipeline.yml referenced five scripts that were never committed, so the
compliance, l9, and docs jobs failed unconditionally on every PR — gate
defects unrelated to any code change. This adds functional implementations,
each with an L9_META header and matching the existing compliance_kb_validate.py
style:

- check_compliance_terminology.py — AST-based guard that fails if app/ code
  imports the deprecated chassis.envelope/router/registry dispatch modules
  (C-21 / ARCH-003). Prose mentions in docs are never flagged.
- docs_link_check_local.py — validates relative markdown links; defaults to the
  root governance docs, supports explicit paths and --all.
- docs_consistency_local.sh — runs the doc presence check, KB validation, and
  link check; non-zero on any failure.
- run_pr_select_gates.py — reads gates.json from `l9_contract_control select-gates`
  and runs each selected command, reporting all failures.
- contract_bound_local.py — thin CLI over l9_contract_control.build_review_signal;
  flags contract-bound changes lacking required companion updates.

Verified each runs clean on main's content (terminology: 134 files ok; links:
6 root docs ok; select-gates/contract-bound: correct pass/fail on forced inputs).
ruff check + format clean.

Co-authored-by: Igor Beylin <cryptoxdog@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown

PR Size Report

Metric Value Limit
Lines changed 442 1000
Files changed 6 50
Additions +442 -
Deletions -0 -

WARNING: PR exceeds 300 lines — consider splitting

Best Practices for Large Changes

  1. Refactoring + Features: Separate into 2 PRs
  2. Multiple Features: One PR per feature
  3. Database + Code: Separate migration from logic
  4. Generated Code: Separate from manual changes

@github-actions

Copy link
Copy Markdown

L9 Audit Review

Status

  • Result: pass_with_advisories
  • Mode: explicit_advisory_blocking_tier_policy
  • Total findings visible: 1190
  • Blocking findings: 0
  • Advisory findings: 1190

Policy

  • Flatcase/style findings are advisory.
  • SQL/auth/security/chassis/transport/ingress/contract/runtime findings are blocking when new or touched.
  • Unknown HIGH/CRITICAL findings fail closed as blocking.

Blocking Findings

  • none

Advisory Findings

  • app/score/score_models.py:96 Likely flatcase field 'recommendation' — advisory
  • app/score/score_explainer.py:54 Likely flatcase field 'recommendation' — advisory
  • app/score/score_explainer.py:103 Likely flatcase field 'recommendations' — advisory
  • app/agents/deal_risk.py:36 Likely flatcase field 'recommendations' — advisory
  • app/services/simulation_bridge.py:1507 f-string SQL query -- injection risk — advisory
  • app/services/crm/salesforce_client.py:179 f-string SQL query -- injection risk — advisory
  • app/score/score_api.py:40 FastAPI import in engine module -- chassis isolation violation — advisory
  • app/bootstrap/l9_contract_runtime.py:32 FastAPI import in engine module -- chassis isolation violation — advisory
  • app/core/auth.py:34 FastAPI import in engine module -- chassis isolation violation — advisory
  • app/core/auth.py:35 FastAPI import in engine module -- chassis isolation violation — advisory
  • app/middleware/rate_limiter.py:27 FastAPI import in engine module -- chassis isolation violation — advisory
  • app/api/v1/converge.py:19 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:20 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:21 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:22 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:23 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:24 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:25 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:26 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:32 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:132 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:133 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:197 Deep relative import (level=3) — advisory
  • app/api/v1/converge.py:198 Deep relative import (level=3) — advisory
  • app/api/v1/intake.py:18 Deep relative import (level=3) — advisory

... truncated 1165 additional findings ...


Generated by L9 Audit Engine (tools/audit_engine.py)

@cursor
cursor Bot marked this pull request as ready for review July 19, 2026 21:50
The pr-pipeline docs job installs only Python (no third-party deps), but the
script delegated KB YAML validation to compliance_kb_validate.py, which imports
PyYAML -> ModuleNotFoundError: No module named 'yaml' in CI.

Drop the KB validation step from the docs consistency script; KB YAML is already
validated by the validate and compliance jobs (which install PyYAML). The script
now uses only the standard library (doc presence + relative-link check), so it
passes in the minimal docs job.

Co-authored-by: Igor Beylin <cryptoxdog@users.noreply.github.com>
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.

2 participants