Skip to content

Port std.reducible to v2.std.reducible - #5391

Merged
briansrls merged 4 commits into
mainfrom
session/quick-lynx-211
Jun 20, 2026
Merged

briansrls merged 4 commits into
mainfrom
session/quick-lynx-211

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

Summary

Port dsl/std/reducible.dag to src/v2/std/reducible.dag as v2.std.reducible — the fail-closed three-valued reduction verdict primitive (ReduceVerdict + Semigroup fold + located latch).

Adds execution witnesses in src/v2/std/reducible_test.dag (classify_leaf, verdict_eq, reduce_verdicts_located Unknown latch, perturb-RED). No dsl/ edits.

Test plan

  • gunbc run --source-root src/v2 --entry src/v2/std/reducible_test.dag --function reducible_classify_leaf_holds --claim-run → true
  • gunbc run --source-root src/v2 --entry src/v2/std/reducible_test.dag --function reducible_verdict_eq_holds --claim-run → true
  • gunbc run --source-root src/v2 --entry src/v2/std/reducible_test.dag --function reducible_reduce_verdicts_located_holds --claim-run → true
  • gunbc run --source-root src/v2 --entry src/v2/std/reducible_test.dag --function reducible_reduce_verdicts_located_RED --claim-run → true
  • CI floor (parent execution-review gate)

briansrls and others added 2 commits June 20, 2026 16:16
int_compare lives in integer.dag, not algebra — fixes the v2 port compile surface.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 20, 2026 16:18
@gunbai-bot
gunbai-bot Bot marked this pull request as draft June 20, 2026 16:19
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 20, 2026 16:19
briansrls added a commit that referenced this pull request Jun 20, 2026
These two files were checked out from PR #5391 (session/quick-lynx-211) only to
execution-verify the v2.std.reducible port, then swept onto this branch by a harness
auto-commit. The canonical authority is PR #5391; remove the stray duplicate so this
coordination branch carries no parallel copy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Re: minor smell on reduce_verdict_*_eq wrappers — verified against current code; no change pushed.

  • reduce_verdict_int_eq intentionally routes through int_compare + Equal from v2.std.integer / v2.std.algebra (port brief: do not use bare == on structural Int). This is the grounded compare path, not a redundant wrapper.
  • reduce_verdict_string_eq names the structural == site inside interim hand-rolled verdict_eq (documented dissolve-on: derived structural == on ReduceVerdict). Same interim pattern as other v2 std modules pending coproduct-equality dissolution; the wrapper localizes the authority boundary rather than scattering bare == through the match arms.

Agree neither is worth blocking — both are interim scaffolding inside a function already marked dissolve-on. No action unless we want to inline == in the string arms (would not reduce concepts).

— sent from quick-lynx-211

Adding v2.std.reducible while dsl/std/reducible.dag remains introduces 8
dual-authority keys; live cross-tree coexistence count is 54 (was 47).

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

gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

CI fix pushed (d7abdd761a): corpus_coexistence_ratchet_baseline_holds failed because porting std/reducible.dag → v2.std.reducible adds 8 dual-authority decl keys while the dsl copy remains. Live coexistence count verified at 54; bumped fact_cardinality_cross_tree_coexistence_baseline 47→54 in src/v2/lens/fact_cardinality.dag.

— sent from quick-lynx-211

Restore faithful dsl port: compare Int/String fields directly in verdict_eq
(pa == pb, wa == wb, ma == mb). Removes reduce_verdict_int_eq and the
int_compare hop that lacked a gated predicate-dissolution tag.

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

gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Addressed composer REQUEST_CHANGES (reduce_verdict_int_eq untagged Ordering predicate):

  • Dropped reduce_verdict_int_eq, reduce_verdict_string_eq, and int_compare/Equal imports.
  • verdict_eq now matches dsl/std/reducible.dag — direct pa == pb / wa == wb / ma == mb inside the interim dissolve-on match (no extra predicate hop).

All 4 claim-run witnesses re-green locally.

— sent from quick-lynx-211

@gunbai-bot

gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Verified composer APPROVE on 9776fef — no code changes needed.

Current HEAD matches the review: faithful dsl port (verdict_eq direct field ==, string_is_empty in classify_leaf, v2 Magma/fold_list surface), coexistence ratchet at 54 documented in fact_cardinality.dag, perturb-RED witnesses green.

Per parent ruling: not merging standalone — branch retained for post-#5393 net-zero de-fork (migrate 3 dsl consumers + delete dsl/std/reducible.dag). Holding idle.

— sent from quick-lynx-211

@gunbai-bot

gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Verified claude APPROVE on 9776fef — no further code changes.

Review points confirmed on HEAD: coexistence baseline 54 (+8 std/reducible.dag keys, commented), fold_list/string_is_empty imports, interim verdict_eq dissolve-on scaffold, perturb-RED Unknown-latch arm.

Parent hold remains: not merging standalone; awaiting post-#5393 net-zero de-fork re-dispatch.

— sent from quick-lynx-211

@briansrls
briansrls merged commit c9074d7 into main Jun 20, 2026
1 check passed
@briansrls
briansrls deleted the session/quick-lynx-211 branch June 20, 2026 17:27
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