Skip to content

Formalize extdeps external-authority anchors + CI enforcement lens - #5297

Closed
gunbai-bot[bot] wants to merge 26 commits into
mainfrom
session/vivid-eagle-345-extdeps-external-authority
Closed

gunbai-bot[bot] wants to merge 26 commits into
mainfrom
session/vivid-eagle-345-extdeps-external-authority

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds std.external_authority.ExternalAuthorityAnchor as the canonical carrier for upstream spec citations (§3 grounding).
  • Requires every dsl/extdeps/ module to declare data extdeps_external_authority_anchor: ExternalAuthorityAnchor = … with an external http(s) URL.
  • Introduces v2.lens.extdeps_external_authority with a Rust parse-bridge projection and enrolls ExtdepsExternalAuthorityGate on the CI floor (clean-tree + RED scanner witnesses).

All 153 extdeps modules are migrated; internal DESIGN.md URLs on realization/dag-language scaffolds were replaced with external concept anchors.

Test plan

  • cargo test -p v1-compiler --lib extdeps_external_authority
  • gunbc run … extdeps_external_authority_clean_over_live_tree_holds --claim-run → true
  • gunbc run … scanner_missing_anchor_detects_holds --claim-run → true
  • gunbc run --source-root dsl --entry dsl/tools/extdeps_external_authority_gate.dag --function main → ExitSuccess
  • gunbc run … ci_spec_witnesses --claim-run → true
  • gunbc run … ci_floor_plan_witnesses --claim-run → true

@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 19, 2026 17:33
@gunbai-bot gunbai-bot Bot changed the title Formalize the extdeps external-authority ANCHOR + build a CI-enrolled fail-closed enforcement LENS (operator-requested, asap). (1) FORMALIZE: every extdeps/ module must declare an Anchor on an EXTERNAL authority — a real URL to a wiki/ISO/ECMA/vendor SPEC page (the concept, NOT the umbrella company; Formalize extdeps external-authority anchors + CI enforcement lens Jun 19, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as draft June 19, 2026 18:02
briansrls added a commit that referenced this pull request Jun 19, 2026
Address REQUEST_CHANGES from api-review:
- Add Hand-Rust scaffold receipt to extdeps_external_authority_project.rs
  and lens header (dissolve-on SourceRootIngest #5126).
- Route http(s) anchor scheme check through std.markup href_is_http
  instead of a forked is_prefix_of predicate.
- Mark extdeps_anchor_url_is_internal_doc as 🟢 lens policy (no std
  authority for repo-internal design-doc URLs).

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Review feedback addressed (42783ea4bd)

1. Missing hand-Rust P5 receipt — fixed

Added the §7/P5 scaffold receipt to extdeps_external_authority_project.rs (same shape as module_path_index.rs: superseded informal scaffold, lens+gate wiring, this module + seed builtin, dissolve-on ROADMAP.md Lane 3a SourceRootIngest #5126). Lens header now points at that receipt instead of only naming the file path.

2. Forked extdeps_anchor_url_is_http_external — fixed

Removed the local is_prefix_of predicate; violation classification now calls std.markup.href_is_http (single authority for http(s) scheme checking).

3. extdeps_anchor_url_is_internal_doc without disposition — fixed

Tagged 🟢 lens policy: there is no std surface for “repo-internal design-doc URL”; this predicate encodes the extdeps-specific grounding rule (external upstream spec pages only; DESIGN.md/ROADMAP.md are §3 workflow facts, not extdeps anchors).

Witnesses re-run green locally (clean_tree, RED scanner fixture).

— sent from vivid-eagle-345

briansrls added a commit that referenced this pull request Jun 19, 2026
…ckfill)

Operator rework — model before rollout:
- Add std/uri.dag (RFC 3986 UriScheme closed sum, uri_scheme_is_http match)
- Add std/stable_authority.dag (StableAuthority{uri: Uri}, FactAuthorityOverride)
- Replace external-authority lens with extdeps_stable_authority (no string matching,
  no external-only / internal-doc violations; file: anchors valid)
- Lens-unit green/RED witnesses + uri_witness_test; gate runs model phase only
- Revert tree-wide 159-file extdeps anchor backfill; remove Rust text-scanner
- Rename CI gate ExtdepsStableAuthorityGate; live-tree projection deferred

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 19, 2026 20:47
briansrls added a commit that referenced this pull request Jun 19, 2026
RFC 3986 is external authority — Uri belongs in extdeps, not std.
Move std/uri.dag → extdeps/uri.dag, std/stable_authority.dag →
extdeps/stable_authority.dag with DESIGN.md §3 self-anchor (File:).
Lens + witnesses import extdeps.*; std never touches anchor machinery.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as draft June 19, 2026 21:03
@gunbai-bot

gunbai-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Intentionally draft — not abandoned. Operator/smart-eagle-107 froze #5297 while the Uri+StableAuthority model rework is reviewed (441b71d8fe: extdeps/uri, extdeps/stable_authority, lens-unit gate green). Do not mark ready until smart-eagle signs off on the model; staged anchor backfill comes after that.

CI: green (27847831610).

— sent from vivid-eagle-345

@gunbai-bot

gunbai-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

CI alert @ `42783ea` is stale — branch tip is `441b71d8fe`; latest CI run 27847831610 pass (11m47s). The `42783ea` failure was pre-rework (dsl compile / uri_witness v2.std import); fixed in subsequent commits. No new push — HALT per smart-eagle-107, awaiting reference spec.

— sent from vivid-eagle-345

@gunbai-bot

gunbai-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

CI alert @ `1449d85` (merge origin/main) is stale — superseded by `4502485ad7` rework + `441b71d8fe` extdeps correction. Tip CI: 27847831610 pass. No push (HALT / awaiting reference spec).

— sent from vivid-eagle-345

briansrls added a commit that referenced this pull request Jun 19, 2026
Squash the rework onto current main: extdeps Uri + StableAuthority,
lens-unit gate, CI wiring — no tree-wide anchor backfill.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the session/vivid-eagle-345-extdeps-external-authority branch from 441b71d to bb5d1a8 Compare June 19, 2026 21:18
@gunbai-bot

gunbai-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Still intentionally draft — not abandoned.

Parent loop (smart-eagle-107): HALT remains in effect until the authoritative reference spec lands (projection mechanism + model sign-off). Do not mark ready from dashboard nudges until that review completes.

Since last nudge:

  • Merge conflict with main resolved — branch rebased/squashed to bb5d1a883b (1 commit on b71cb0ee16)
  • Mergeable: yes (no conflicts)
  • Scope: extdeps Uri + StableAuthority, lens-unit gate, CI wiring only — no tree-wide anchor backfill
  • CI: pending on new tip (run)

Next gate: smart-eagle reference spec → implement → model approval → staged rollout. Not closing.

— sent from vivid-eagle-345

briansrls added a commit that referenced this pull request Jun 19, 2026
…lice 1)

Per smart-eagle-107 spec: ExternalUri|Internal StableAuthority sum, two
*_for_qualified_name projection builtins in extdeps_shape_transport_policy_project
(~30 lines, dissolve-on #5126), lens with MissingFormalAnchor +
UnrecognizedAnchorScheme only, live self-anchor GREEN + RED perturb fixtures.
ExtdepsStableAuthorityGate removed from CI floor (advisory slice 1).

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jun 19, 2026
Squash the rework onto current main: extdeps Uri + StableAuthority,
lens-unit gate, CI wiring — no tree-wide anchor backfill.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jun 19, 2026
…lice 1)

Per smart-eagle-107 spec: ExternalUri|Internal StableAuthority sum, two
*_for_qualified_name projection builtins in extdeps_shape_transport_policy_project
(~30 lines, dissolve-on #5126), lens with MissingFormalAnchor +
UnrecognizedAnchorScheme only, live self-anchor GREEN + RED perturb fixtures.
ExtdepsStableAuthorityGate removed from CI floor (advisory slice 1).

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the session/vivid-eagle-345-extdeps-external-authority branch from 4d37db5 to 3fe64c5 Compare June 19, 2026 21:42
briansrls added a commit that referenced this pull request Jun 19, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jun 19, 2026
…iew fixes)

- Collapse Internal/ExternalUri into StableAuthority{uri}; internal = file:
  with section in locator fragment (DESIGN.md#3-single-authority).
- Projector reads StableAuthority record structurally (present|absent kind).
- Live clean-tree + clean https/file lens-unit witnesses via builtins; RED
  missing/bogus-scheme fixtures unchanged. Layer already extdeps/.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls and others added 7 commits June 19, 2026 22:29
Squash the rework onto current main: extdeps Uri + StableAuthority,
lens-unit gate, CI wiring — no tree-wide anchor backfill.

Co-authored-by: Cursor <cursoragent@cursor.com>
…lice 1)

Per smart-eagle-107 spec: ExternalUri|Internal StableAuthority sum, two
*_for_qualified_name projection builtins in extdeps_shape_transport_policy_project
(~30 lines, dissolve-on #5126), lens with MissingFormalAnchor +
UnrecognizedAnchorScheme only, live self-anchor GREEN + RED perturb fixtures.
ExtdepsStableAuthorityGate removed from CI floor (advisory slice 1).

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…iew fixes)

- Collapse Internal/ExternalUri into StableAuthority{uri}; internal = file:
  with section in locator fragment (DESIGN.md#3-single-authority).
- Projector reads StableAuthority record structurally (present|absent kind).
- Live clean-tree + clean https/file lens-unit witnesses via builtins; RED
  missing/bogus-scheme fixtures unchanged. Layer already extdeps/.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the session/vivid-eagle-345-extdeps-external-authority branch from 5080c73 to b5ab885 Compare June 19, 2026 22:29
- Drop tautological uri_scheme_is_recognized; tag remaining uri predicates
  🟢 TERMINAL (scheme recognition for anchors stays in lens decode_uri_scheme).
- Finish live projection: machinery exemption, derived extdeps roster scan,
  discriminating anchor-drop corpus witness via live_violations_if_enrolled.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls and others added 2 commits June 20, 2026 02:32
After hard-reset to verified slice-1 (55e304d) + merge origin/main,
append extdeps.toolchain.{architecture_profile,types} and
extdeps.version.pep440 to the 163-entry snapshot — snapshot maintenance
only, not slice-2 anchor migration.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the session/vivid-eagle-345-extdeps-external-authority branch 2 times, most recently from f8d6101 to b3a84ab Compare June 20, 2026 02:40
@gunbai-bot
gunbai-bot Bot marked this pull request as draft June 20, 2026 02:56
Accidental drop in slice-1 rework (d5d5e28) unrelated to stable-authority
work. Restores main's ci_rust_gate_test_command substring filter so the
wet/hermetic equivalence unit tests stay in the rust monolith gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Review response (claude-opus-4-7 / dashboard artifact)

uri_scheme_is_http / uri_is_url (uri.dag:34-46) — Valid observation, no slice-1 change. These are 🟢 TERMINAL closed-sum membership helpers on the extdeps citation carrier; live anchor enforcement uses decode_uri_scheme constructor-identity equality in the lens, not these predicates. Agree a UriSchemeClass = Web | NonWeb axis is the right dissolution if a second consumer needs the same split — deferred.

stable_authority_backfill_pending.txt parallel representation — Acknowledged scaffold. Shrinking exclusion roster with explicit dissolution trigger (file → empty ⇒ all modules fail-closed). Wired through extdeps_stable_authority_is_backfill_pending_for_qualified_name; migration to a data row is the named follow-up, not slice-1 scope.

ci_spec.dag wet_hermetic filter drop — Valid catch. Accidental collateral in d5d5e285ce, not intentional. Fixed in a911c28ff6: restored wet_hermetic alongside interp_recorded_fixture and resolve_expr_types_retraversal in ci_rust_gate_test_command (matches main). Not moved to discovery floor — still rust monolith gate coverage.

Verdict APPROVE — acknowledged; slice-1 remains advisory/off-floor, draft, holding for operator.

— sent from vivid-eagle-345

@gunbai-bot

gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Review response (composer-2.5 / dashboard artifact)

Findings: None — verified on current tip a911c28ff6.

Spot-check against the approval rationale:

Post-review delta since b3a84abd6e: a911c28ff6 only restores accidental wet_hermetic drop in ci_rust_gate_test_command (review feedback from opus-4-7) — no slice-1 semantics change.

Verdict APPROVE — acknowledged.

— sent from vivid-eagle-345

@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 20, 2026 05:40
@gunbai-bot
gunbai-bot Bot marked this pull request as draft June 20, 2026 05:46
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 20, 2026 05:58
@gunbai-bot
gunbai-bot Bot marked this pull request as draft June 20, 2026 06:18
@gunbai-bot

gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Response to cursor/composer-2.5 review (REQUEST_CHANGES)

Session posture: vivid-eagle-345 is frozen (operator draft hold + smart-eagle-107 STOP) pending operator ruling on stable_authority vs external_authority framing. I am not pushing commits until that ruling lands — a fix commit now would extend the external_authority rework path that may be reset to verified slice-1 (b3a84abd6e, tag verified-slice1-5297). Findings verified below; fixes queued for whichever direction operator confirms.


Finding 1 — anchor_kind_is_absent / anchor_kind_is_present string bridge predicates (extdeps_external_authority.dag:47-53)

Verdict: Valid, but pre-existing in signed-off slice-1.

On current HEAD these predicates match "absent" / "present" strings from the Rust *_anchor_kind_for_qualified_name builtin instead of folding through ExtdepsExternalAuthorityAnchorStatus directly. That is a parallel validator family.

However, the same pattern exists in verified slice-1 at b3a84abd6e (extdeps_stable_authority.dag:51-57) — the bridge returns string tags because the seed projector exports present|absent kind strings, not the .dag coproduct. The fix (structural fold or explicit 🟡 dissolve-on #5126 disposition on the predicate pair) applies to whichever lens survives the operator ruling.

No 🟢 TERMINAL claim intended for these bridge-tag predicates (unlike uri_scheme_is_http).


Finding 2 — Missing P5 Hand-Rust scaffold receipt block in lens header

Verdict: Valid.

extdeps_external_authority.dag:1-12 cites (dissolve-on #5126) but omits the checkable receipt block that extdeps_shape_transport_policy.dag:10-14 carries (withdrawn scaffolds, builtin census, ROADMAP Lane 3a). The Rust bridge at extdeps_shape_transport_policy_project.rs:566+ should be referenced in that receipt.

Note: slice-1 extdeps_stable_authority.dag at b3a84abd6e has the same omission — incremental scaffold debt, not unique to this rework. Will add the receipt block when branch direction is confirmed.


PR description accuracy

Reviewer note is correct: description overclaims full module migration. Code correctly models slice-1/backfill — external_authority_backfill_pending.txt has 169 lines; only machinery module extdeps.external_authority carries a production anchor on this branch.


Merge readiness (re-evaluated)

Gate Status
≥2 api-review APPROVE ❌ REQUEST_CHANGES open; prior approvals staled
No open REQUEST_CHANGES ❌ This review
mergeable=CLEAN ✅
CI green ✅ (runs 27861806023, 27862214814 on dc7cd6ad84)
Operator draft freeze ❌ Draft, explicit "do not merge" until framing ruling
Design fork unresolved ❌ NonExternalAnchorScheme / file: RED vs slice-1 internal-valid

Not merge-ready. Holding for operator binary ruling; ready to hard-reset to b3a84abd6e or apply these review fixes on the confirmed branch — on command only.

— sent from vivid-eagle-345

briansrls and others added 3 commits June 20, 2026 14:34
Main merge pulled extdeps.bmc.http; corpus_live_* witnesses failed on
snapshot staleness, not anchor logic. One-line roster maintenance per
smart-eagle-107 hold guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls marked this pull request as ready for review June 20, 2026 19:18
@briansrls briansrls closed this Jun 20, 2026
briansrls added a commit that referenced this pull request Jun 21, 2026
…ive #5297) (#5418)

* extdeps: external-authority anchor carrier + fail-closed CI lens (revive #5297)

Land the never-merged #5297 mechanism onto current main: a structured,
lens-checkable external-authority citation on every dsl/extdeps module,
enforced fail-closed on the CI floor.

Carriers
- extdeps.uri: Uri { scheme: UriScheme, locator } with closed-sum
  UriScheme = Http | Https | File | Ftp (RFC 3986 / 7595 grounded).
- extdeps.external_authority: ExternalAuthority { uri }, FactAuthorityOverride,
  and the canonical `data extdeps_external_authority_anchor` row.

Lens (v2.lens.extdeps_external_authority)
- Fail-closed live policy per module: machinery-exempt -> backfill-pending ->
  else require a present external Http/Https anchor. Scheme decoded by exhaustive
  constructor identity (decode_uri_scheme), never a URL-prefix string.
- Violations: MissingFormalAnchor / UnrecognizedAnchorScheme / NonExternalAnchorScheme.

Host projection (extdeps_shape_transport_policy_project.rs)
- Structural read of the anchor record; live roster derived from the module-path
  index (declared module name, not directory); backfill + machinery-exempt facts.
- 9 builtins wired through 04_method.dag / v1_interpreter.rs / v1_compiler_infer_method.rs.

CI
- ExtdepsExternalAuthorityGate enrolled in gunbc_ci_spec and scheduled on the floor;
  runs uri witnesses + live-corpus clean-tree + RED perturb receipts.

44 extdeps modules carry external anchors; 125 remain in the shrinking
backfill_pending snapshot.

Reconciliation onto current main: the snapshot keys on declared module name, so
the post-#5391 directory reorganizations (rust/, package_managers/, ...) need no
rename. The only stale entry, extdeps.diagnostic.redfish, was dropped (redfish
moved to extdeps.bmc.redfish, separately covered).

Verified by execution: 18 projection unit tests; 14 floor-enrolled .dag witnesses
(GREEN clean-tree + machinery-exempt fold + 3 RED perturbs + live anchor-drop RED);
live-tree discrimination on a real cited module (Https->File and anchor-drop both
flip the gate RED, revert restores GREEN); ci_spec/ci_floor_plan enrollment
witnesses; gate main -> ExitSuccess via real shell; cargo fmt + clippy -D warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Mi3t2wX7UPzgqLyYAE1kS

* ci_floor_plan: add missing gate_is_heavy_resolve arm for ExtdepsExternalAuthorityGate

#5418 added ExtdepsExternalAuthorityGate to the Gate enum and to every match
over it EXCEPT gate_is_heavy_resolve (ci_floor_plan.dag:154), so once the v1↔v2
FreeMonoid collision cleared (#5422 now in this branch) the plan resolve reached
this fn and fail-closed on a non-exhaustive match:

  ci_floor_plan.dag:154:3: error: non-exhaustive match:
    missing variant(s) ExtdepsExternalAuthorityGate

The extdeps external-authority gate is a focused lens witness (filesystem_read
over dsl/extdeps/**), not a whole-tree heavy resolve like SourceRootIngest /
DslCompileClean — so it joins the other lens gates (Layering/ResolvedImports) at
`false`. Plan-data only; resolved at runtime by claim_executor, no stage0 seed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* extdeps live-clean: anchor the 4 access modules + backfill the cache key-completeness lens

#5418's external-authority gate scans the LIVE extdeps tree and fail-closes on any
module lacking an anchor. Once #5422 cleared the FreeMonoid collision and the missing
gate_is_heavy_resolve arm let the plan resolve, the gate correctly flagged 5 modules
that landed on main AFTER #5418 authored its roster and were neither anchored nor
backfilled:

  missing: extdeps.access.{aws_iam,posix,rbac,zanzibar}   (#5415 access model)
  missing: extdeps.cache.key_completeness                 (#5423 cache lens)

The 4 access modules already carry their real upstream citation in a `// Source:`
comment (AWS IAM grammar, POSIX.1-2017/opengroup, ANSI/NIST RBAC, the Zanzibar USENIX
paper) — promoted each to the structured `extdeps_external_authority_anchor` carrier
the gate gates on (DESIGN §3: the mark on the carrier is the authority). No access
sibling is backfilled, so anchoring (not backfilling) is the consistent treatment.

extdeps.cache.key_completeness is an internal §5 cache-soundness LENS (a pure reader
over the cache catalog), not a cited external-system model — so it joins its 8
extdeps.cache.* siblings on the backfill_pending roster as tracked debt, not a fake
external anchor.

Verified by execution: the floor's discovery-corpus (587 witnesses) and
extdeps_external_authority_gate_passes both go GREEN with this change (live
violation set empty, roster count > 150).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.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.

1 participant