Skip to content

chore(cursor)+docs(workflow,ops): bind engineering doctrine + correct 0.574x reading + lexicon guardrails - #298

Closed
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/data-boar-agent-protocol-c8ad
Closed

cursor[bot] wants to merge 3 commits into
mainfrom
cursor/data-boar-agent-protocol-c8ad

Conversation

@cursor

@cursor cursor Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Description

Implements the safe, in-policy slice of the operator's "doctrine reset" Slack prompt (trigger: #data-boar-ops thread 1777382441.819129). Three atomic, doc-only commits — no code, no connector, no benchmark JSON, no SQL composition — so the regression surface for this PR is the contract guards alone.

The full RCA was posted to Slack before any file was touched, per the SRE Automation Agent protocol. Headline: the operator's prompt asked for three things; one was a real gap, one was a real gap with an inverted performance reading I had to correct, and one was a wholesale README rewrite that would have broken tests/test_readme_stakeholder_pitch_contract.py and contradicted ADR 0035.

What this PR ships

1. chore(cursor) — .cursor/rules/engineering-doctrine-and-performance-baseline.mdc

New situational rule (loaded via globs on rust/, pro/, connectors/sql_sampling.py, report/executive_report.py, core/scan_audit_log.py, cli/reporter.py, the inspirations manifestos, the PR template, and the doctrine plan). Not always-on, by design — token-aware, follows the same load pattern as quality-sonarqube-codeql.mdc and codeql-priority-matrix.mdc.

It binds the existing manifestos to a small, machine-checkable contract:

  • Manifestos are normative. PRs editing governed surfaces must name the engaged clause (e.g. DEFENSIVE_SCANNING §3 dialect posture, FALLBACK §3 demotion log).
  • Sysinternals diagnostic voice for --verbose, audit JSON, executive-report Section 3 (active voice, named subject; not verified for unknowns; ~estimate= for non-counts). Aligns with the always-on publication-truthfulness-no-invented-facts.mdc.
  • Performance baseline reading (this is the operator-correction). speedup_vs_opencore = 0.574 means Pro is 0.574x as fast as OpenCore (Pro takes ~1/0.574 ≈ 1.74x more wall-clock). It is a debt baseline to improve from, not a floor we must stay above. The operator's reset prompt phrased it as a "fail below 0.574x" gate; that is the inverted reading and the rule explicitly tells future agents not to encode it that way. Pinned by tests/test_official_benchmark_200k_evidence.py, tests/test_basic_python_scan_single_pass_parity.py, pro/worker_logic.py, pro/engine.py, docs/ops/SPRINT_GREAT_LEAP_POSTMORTEM.md, docs/plans/BENCHMARK_EVOLUTION.md §8.
  • Sacred lexicon. Data Sniffing / Deep Boring / Safe-Hold / Audit Trail stay un-translated and stay out of the README executive pitch slice (ADR 0035, tests/test_readme_stakeholder_pitch_contract.py). The rule explicitly does not propose a new pitch rewrite.
  • Rust core. cargo fmt --check / cargo clippy --locked -- -D warnings / cargo test --locked required when rust/boar_fast_filter/** changes. Reminder that algorithmic shape in pro/ comes before pushing more work into Rust (so we do not produce Rust that wraps a Python anti-pattern).

2. docs(workflow) — .github/PULL_REQUEST_TEMPLATE.md

Adds an optional "Engineering doctrine" checklist section after the existing Checklist. Items are scoped (skip when not applicable) so doc-only or one-line PRs are not gated on Rust or benchmark ceremony. Mirrors the rule above so the PR author confirms source-of-truth alignment, Rust gates, performance-baseline honesty, lexicon respect, and named manifesto clause when each surface is touched.

3. docs(ops) — docs/ops/inspirations/INSPIRATIONS_HUB{,.pt_BR}.md

  • EN hub: short pointer to the new Cursor rule below the Doctrine table; internal-only "bench voice" blockquote (the precision-instrument framing) — explicitly NOT for the README executive pitch.
  • pt-BR hub: mirrors the Doctrine table that EN already has (was missing in pt-BR), plus the same Cursor rule pointer and bench-voice quote in Brazilian Portuguese (arquivo, compartilhar, seção, usuário; active voice, named subject — honoring docs-locale-pt-br-contract.mdc).

What this PR deliberately does NOT do (and why)

  • No README pitch rewrite. The operator's prompt asked to replace the README.pt_BR.md introduction with a "Bancada de Trabalho" authority quote. The first decision-maker block (## Para gestores e líderes de conformidade … **Farejando com critério:**) is contractually pinned by tests/test_readme_stakeholder_pitch_contract.py and ADR 0035, which deliberately keep deck jargon out of the executive paragraph. Doing the rewrite would have either broken the test or smuggled deck vocabulary into stakeholder copy. The bench-voice quote landed in docs/ops/inspirations/INSPIRATIONS_HUB.pt_BR.md instead, where the audience is internal and the hub already curates manifesto voice.
  • No performance-floor gate at 0.574x. The proposed "if performance falls below 0.574x, enter Safe-Hold" wording inverts the recorded measurement. The rule encodes the correct reading (debt baseline ≠ floor) and points at the existing regression guard, which already pins direction.
  • No connector / SQL / benchmark JSON edits. Defensive Architecture: zero impact on database locks. connectors/sql_sampling.py (WITH (NOLOCK), hard sample caps, statement timeouts, leading SQL comment) is unchanged. No time.sleep introduced anywhere.

Guardrail Dashboard (local run, this branch)

Gate Result
uv run ruff check . Passed (all checks passed)
uv run ruff format --check . Passed (286 files already formatted)
uv run pre-commit run --all-files Passed (Ruff, plans-stats, markdown lint, pt-BR locale, commercial guard, external-tier plan links, uv.lock/requirements.txt match pyproject, PII guard, PII history guard)
uv run bandit -c pyproject.toml -r api core config connectors database file_scan report main.py -ll -q Cleared (no Medium/High findings)
Targeted pytest (test_readme_stakeholder_pitch_contract, test_pii_guard, test_docs_pt_br_locale, test_docs_external_no_plan_links, test_markdown_lint) 145 passed
uv run pytest -q -W error (excluding tests/test_scripts.py) 918 passed, 5 skipped, 0 failed
tests/test_scripts.py (PowerShell parse-only suite) 66 deselected — the cloud agent VM has neither pwsh nor powershell; identical 35 failures reproduce on main before any change in this PR (verified with git stash). Environmental, not caused by this PR. The full check-all.sh will run them on Windows / pwsh-equipped CI workers as usual.
Skipped-test protocol notice The 5 pytest SKIPs are unrelated to this PR's surface (no connector code touched, no Mongo/SQL changes). The 66 deselected PS1 syntax tests are a pre-existing environmental gap on this Linux cloud VM, not a change-related skip.
Supply-chain watch No dependencies added or pinned in this PR; uv.lock and requirements.txt match pyproject.toml per the pre-commit hook above.

Security telemetry obligation

  • Bandit: clean at -ll on the full enforced surface — nothing to justify.
  • CodeQL: runs server-side on push/PR (.github/workflows/codeql.yml); this PR touches only .cursor/rules/, .github/PULL_REQUEST_TEMPLATE.md, and docs/ops/inspirations/, so the CodeQL Python/JavaScript/Markdown query packs have no surface to flag here.

DB-lock non-regression guarantee

Zero connector, zero connectors/sql_sampling.py, zero core/scan_audit_log.py, zero database/, zero report/generator.py change. No time.sleep introduced. The defensive-scanning manifesto contract (sample caps, statement timeouts, WITH (NOLOCK) posture, leading SQL comment) remains exactly as encoded today. This PR cannot regress DB-lock behavior.

Files changed

  • A .cursor/rules/engineering-doctrine-and-performance-baseline.mdc (new, situational; 160 lines)
  • M .github/PULL_REQUEST_TEMPLATE.md (+27 lines, additive checklist section)
  • M docs/ops/inspirations/INSPIRATIONS_HUB.md (+ pointer + bench-voice blockquote)
  • M docs/ops/inspirations/INSPIRATIONS_HUB.pt_BR.md (+ Doutrina table mirror + pointer + bench-voice blockquote in pt-BR)

Related

  • ADR 0035 — README pitch vs deck vocabulary boundary.
  • ADR 0042 — Lab lessons archive contract.
  • docs/plans/PLAN_ENGINEERING_DOCTRINE_CONSOLIDATION.md Slices 1–3 (manifestos shipped, RCA block in cli/reporter.py, single-pass Pro fallback) — this PR is the rule-binding companion to those slices, not new product behavior.
  • docs/plans/BENCHMARK_EVOLUTION.md §8 — operator-pinned 0.574x debt baseline narrative.

Slack RCA thread (private channel #data-boar-ops): trigger 1777382441.819129, RCA reply 1777382824.830139.

Open in Web View Automation 

cursoragent and others added 3 commits April 28, 2026 13:33
Situational rule loaded by globs on rust/, pro/, connectors/sql_sampling.py,
report/executive_report.py, the manifestos under docs/ops/inspirations/, and
.github/PULL_REQUEST_TEMPLATE.md (or via @-mention).

What it binds (no behavior change, all references already exist):
- Manifestos governing fallback hierarchy, defensive scanning posture,
  diagnostic voice, bench discipline, and actionable governance.
- Sysinternals-style diagnostic voice for --verbose, audit JSON, and
  executive-report Section 3 (active voice, named subject, 'not verified'
  for unknowns, '~estimate=' for non-counts).
- Performance baseline reading: speedup_vs_opencore = 0.574 means Pro is
  0.574x as fast as OpenCore (debt baseline to improve from, not a floor
  to stay above). Pinned by tests/test_official_benchmark_200k_evidence.py
  and tests/test_basic_python_scan_single_pass_parity.py. Avoids the
  inverted reading proposed in the operator's reset prompt.
- Sacred lexicon: Data Sniffing / Deep Boring / Safe-Hold / Audit Trail
  stay un-translated and stay out of the README executive pitch slice
  (ADR 0035 + tests/test_readme_stakeholder_pitch_contract.py).
- Rust core: cargo fmt/clippy/test required before PR; reminder that
  algorithmic shape in pro/ comes before pushing more work into
  rust/boar_fast_filter.

Companion edits in this PR:
- docs(workflow): PR template additions (doctrine checklist).
- docs(ops): inspirations hub Doutrina table + bench-voice quote in pt-BR
  (already present in EN); both hubs now point at this rule.

Refs: docs/ops/inspirations/{THE_ART_OF_THE_FALLBACK,DEFENSIVE_SCANNING_MANIFESTO,
INTERNAL_DIAGNOSTIC_AESTHETICS,ENGINEERING_BENCH_DISCIPLINE,ACTIONABLE_GOVERNANCE_AND_TRUST}.md
ADR 0035, ADR 0042, PLAN_ENGINEERING_DOCTRINE_CONSOLIDATION.md, BENCHMARK_EVOLUTION.md.

Co-authored-by: Fabio Tavares Leitão <[email protected]>
Adds an optional 'Engineering doctrine' section to the existing PR template
checklist so contributors honor surfaces governed by the manifestos under
docs/ops/inspirations/ when their PR touches them. Items are scoped (skip
when not applicable) so small PRs are not gated on Rust or benchmark
ceremony.

Items added:
- Source of truth alignment (docs/USAGE, docs/TECH_GUIDE, manifesto, ADR).
- Rust core gate (cargo fmt/clippy/test) when rust/boar_fast_filter changes.
- Performance baseline confirmation when pro/, rust/, or tests/benchmarks/
  change. Reminder line clarifies that speedup_vs_opencore = 0.574 means
  Pro is 0.574x as fast as OpenCore (debt baseline, not floor) so PR copy
  does not double-invert the figure.
- Sacred lexicon (Data Sniffing / Deep Boring / Safe-Hold / Audit Trail
  stay un-translated and stay out of README executive pitch — ADR 0035).
- Defensive scanning manifesto clause naming when touching SQL composition.

Companion to .cursor/rules/engineering-doctrine-and-performance-baseline.mdc.

Co-authored-by: Fabio Tavares Leitão <[email protected]>
EN hub (INSPIRATIONS_HUB.md):
- Add a short pointer below the existing Doctrine table to the new
  situational Cursor rule that binds the manifestos to PR review.
- Add an internal-only 'bench voice' blockquote (precision-instrument
  framing) for maintainer surfaces — explicitly NOT for the README
  executive pitch (anchored by ADR 0035 + tests/test_readme_stakeholder_pitch_contract.py).

pt-BR hub (INSPIRATIONS_HUB.pt_BR.md):
- Mirror the Doctrine table that EN already has (was missing in pt-BR).
- Same Cursor rule pointer and bench-voice quote in Brazilian Portuguese
  ('Data Boar não é software de prateleira; é instrumento de precisão...'),
  honoring docs-locale-pt-br-contract: 'arquivo', 'compartilhar', 'seção',
  'usuário'; active voice, named subject.

No README pitch surgery (would have broken
tests/test_readme_stakeholder_pitch_contract.py and leaked deck vocabulary
into the stakeholder slice — see RCA in PR description).

Co-authored-by: Fabio Tavares Leitão <[email protected]>
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