Skip to content

feat(SILVER-RING-DR-04): 8 ring-architecture lint rules with T+30 escalation (closes #462) - #484

Merged
gHashTag merged 1 commit into
mainfrom
ring-446-silver-ring-dr-04
May 2, 2026
Merged

gHashTag merged 1 commit into
mainfrom
ring-446-silver-ring-dr-04

Conversation

@gHashTag

@gHashTag gHashTag commented May 2, 2026

Copy link
Copy Markdown
Collaborator

SILVER-RING-DR-04 — ring-architecture lint rules

Silver-tier ring under trios-doctor GOLD crate. Encodes the eight ring-architecture rules the constitution actually cares about into one lint engine with T+30 escalation.

Rules

Id Rule Heuristic
R-RING-FACADE-001 outer GOLD src/lib.rs ≤ 50 LoC, re-exports only is_facade_only predicate + LoC cap
R-RING-DEP-002 Silver-tier has no I/O tokio / reqwest / tonic / rusqlite forbidden under rings/SILVER-* and rings/SR-*
R-RING-FLOW-003 data flows down (Silver→Bronze) path dep ../BR-* from Silver Cargo.toml
R-RING-BR-004 Bronze re-exposed via parent GOLD facade outer src/lib.rs mentions _br_ / br_output
R-MCP-BRIDGE-005 MCP bridge rings under vendor/tri-mcp/rings/ dir name contains mcp outside that path
R-L1-ECHO-006 no .sh files inside crates/ extension scan
R-L6-PURE-007 no .py files inside crates/ extension scan
R-COQ-LINK-008 Bronze BPB sinks reference Coq theorem id grep COQ_THEOREM_ID

Escalation

[doctor.escalation]
t_plus_30 = "2026-06-01T00:00:00Z"

EscalationConfig::severity_at(now) flips Severity::Warn → Severity::Error once the wall clock crosses t_plus_30. Until then every finding is non-blocking.

Surface

let cfg = EscalationConfig { t_plus_30: DoctorConfig::default_t_plus_30() };
let findings = RuleEngine::new().run(&workspace_root, &cfg, Utc::now())?;

R5-honest scope

  • ✅ 8 rules + tempdir-fixture tests + escalation logic
  • ❌ Wiring RuleEngine into the trios-doctor GOLD facade — lands in DR-05
  • ❌ Real-world pass over gHashTag/trios workspace — lands when DR-05 wires in

Tests — 16/16 GREEN

empty_workspace_has_no_findings
escalation_warn_before_error_after
doctor_config_parses_escalation
is_facade_only_accepts_reexports_and_docs
is_facade_only_rejects_business_logic
r1_accepts_clean_facade
r1_flags_business_logic_in_outer_facade
r2_flags_silver_with_tokio
r3_flags_silver_depending_on_bronze
r4_flags_bronze_without_facade_reexport
r5_flags_mcp_outside_vendor
r6_flags_sh_in_crates
r7_flags_py_in_crates
r8_accepts_bronze_with_coq_link
r8_flags_bronze_bpb_sink_without_coq_link
rule_id_slugs_are_stable

cargo clippy --manifest-path crates/trios-doctor/rings/SILVER-RING-DR-04/Cargo.toml --all-targets -- -D warnings → 0 warnings.

Constitutional compliance

  • R-RING-FACADE-001 ✓ ring is dead-code from gold until DR-05 wires it in (recursive)
  • R-RING-DEP-002 ✓ Silver-tier deps: serde, serde_json, toml, chrono, walkdir, thiserror; dev tempfile. No tokio, no reqwest, no subprocess.
  • R-L1-ECHO-006 ✓ no .sh here
  • R-L6-PURE-007 ✓ no .py here
  • L13 ✓ single ring scope
  • I5 ✓ README.md, TASK.md, AGENTS.md, RING.md, Cargo.toml, src/lib.rs
  • L14 ✓ Agent: Doctor-Doctrine trailer

CI honest disclosure

Pre-existing failures on main (I5 red on legacy crates/trios-a2a/rings/* and crates/trios-mcp/rings/*, ARCH-UI, generic Test) are out of scope. Merge via --admin --squash --delete-branch per EPIC #446 stewardship.

Closes #462
Part-of: #446

🌻 α_φ = φ⁻³/2 ≈ 0.1180 · φ²+φ⁻²=3 · TRINITY

…alation

Silver-tier ring under trios-doctor GOLD crate:
- R-RING-FACADE-001 outer GOLD src/lib.rs ≤ 50 LoC, re-exports only
- R-RING-DEP-002    Silver-tier no-I/O dep enforcement
- R-RING-FLOW-003   data flows down (Silver→Bronze)
- R-RING-BR-004     Bronze re-exposed via parent GOLD facade
- R-MCP-BRIDGE-005  MCP bridge rings under vendor/tri-mcp/rings/
- R-L1-ECHO-006     no .sh inside crates/
- R-L6-PURE-007     no .py inside crates/
- R-COQ-LINK-008    Bronze BPB sinks reference COQ_THEOREM_ID

EscalationConfig: warn-severity findings flip to error after
[doctor.escalation] T_plus_30 (default 2026-06-01).

16 unit tests GREEN, clippy 0 warnings, tempfile-based fixtures.

R-RING-FACADE-001 honored (recursive: facade dead-code from gold
until DR-05 wires RuleEngine in).
R-RING-DEP-002 honored (Silver-tier deps only: serde, serde_json,
toml, chrono, walkdir, thiserror; no tokio/reqwest/tonic).
I5 honored (README.md, TASK.md, AGENTS.md, RING.md, Cargo.toml,
src/lib.rs).

Closes #462
Part-of: #446

Agent: Doctor-Doctrine
@gHashTag
gHashTag force-pushed the ring-446-silver-ring-dr-04 branch from 53721d5 to 4a48082 Compare May 2, 2026 10:57
@gHashTag
gHashTag merged commit 3880ff2 into main May 2, 2026
1 check passed
@gHashTag
gHashTag deleted the ring-446-silver-ring-dr-04 branch May 2, 2026 10:57
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.

🛠 [SILVER-RING-DR-04] doctor rules R-RING-FACADE/DEP/FLOW/BR/MCP/L1/L6/COQ

1 participant