Skip to content

feat: close P0.1 #63 Read|Write Deferred gate, open P4 RON SDK, and queue P1 consumers - #96

Merged
srinji-kaggss merged 4 commits into
mainfrom
feat/next-workstream-gate-63
Aug 31, 2026
Merged

srinji-kaggss merged 4 commits into
mainfrom
feat/next-workstream-gate-63

Conversation

@srinji-kaggss

Copy link
Copy Markdown
Owner

Parent #74 ROADMAP Phase 0 → Phase 3 handoff. Implements U1 of docs/plans/2026-08-31-002-next-workstream-prioritization.md and scaffolds the parallel U5 RON lane; queues U3/U4 as documented prep.

U1 — P0.1 #63 closed (D-FLOW.13 LOCKED 2026-08-31, this PR):

  • Adds closed JustificationGate { Enforced, Deferred { reason, required_by_version } } with strict canonical Value codec (INV-FLOW-019, disjoint wire shapes, single-key map, unknown-field fail-closed). Deferred is loud in wire/manifest/receipt/diagnostic and never coerces to Enforced (10 tests: round-trips, bijection via encode/decode_strict, deferred_never_serializes_as_enforced, diagnostic contains reason).
  • Records Director decision in spec/braid/DECISIONS.md D-FLOW.13: v0 interop collapses to Read|Write, Safe×Authorized enforced, Justified deferred with reason + future required_by_version, D-FLOW.6 unchanged, full AdmittedRead/AdmittedWrite lowering deferred.

U2 — #75 publish (verification on new head, this PR):

  • cargo metadata --locked exit 0, sibling check proves no path = outside workspace (grep path = only intra-workspace), ./scripts/braid-registry-export-check.sh twice exit 0 deterministic bytes=1058 sha=1fac... + KAT CID afaa..., file:// probe file:///Users/srinji/Braid <HEAD> exit 0 registry_cid=afaa... capsule_cid=cced... verdict=admit lock_sha=... (remote https://…/Braid.git ca777aa probe also afaa/cced/admit baseline), fail-closed deadbeef rev not found, tag leaves no artifact.

U5 — P4 #58 RON SDK scaffold (parallel lane, this PR):

  • New braid-flow-sdk workspace member (lgwks_std facade, no new external edge) owning the single authority for 16 MiB / depth 64 envelope checked before AST via allocation-free scan (strings/comments skipped, brackets balanced) + declared bounds (10k/50k/128/50k/250k) checked before try_reserve (INV-FLOW-004). JSON interop/inspection-only (closed ALLOWED_JSON_FIELDS, float/__lossy loss ⇒ Malformed INV-FLOW-018), YAML importer-only.
  • Must-refuse tests: cargo test -p braid-flow-sdk --test source_equivalence -- unknown_and_lossy_sources_refuse 1 passed, cargo test -p braid-flow-sdk --test hostile_ron -- source_envelope_refuses_before_ast_allocation 1 passed (MAX+1, depth 65, quoted brackets ignored, bounds before reserve), cargo test -p braid-flow-sdk -p braid-cli -p braid-render --all-targets green, workspace green, clippy -D warnings 0, fmt 0.

U3 — #76 consumers (prep, blocked on tag push, documented):

  • Canonical audit: Braid git@github.com:srinji-kaggss/Braid HEAD f426296, kernel /Users/srinji/logic-os-kernel HEAD 7405623 (kernel/Cargo.toml:213-214 still path = + BRAID_PIN braid-v0.2 0955e05 stale vs new braid-contract-v0.1.0 afaa...), canonical browser /Users/srinji/next-gen-browser-engine 50a7127 on governance/constellation-charter vs stale /Users/srinji/src/browser-engine 9bc5d15 (BraidTerm 0 hits, sha256 6 CSP-only, vendor/braid 4 crates + 5 Cargo hits), second Cid be-axiom::Cid(String) b3:hex vs canonical braid_ir::Cid([u8;32] BLAKE3 domain len payload lw.braid.*) (~25 hits split, browser_types.rs:7 re-exports canonical).
  • Scratch file:// probe 7baccbd lock_sha 9e62… proves next tag consumable; design drafted for kernel registry.cid() == afaa... parity assert + Cargo git pin and browser vendor/braid + be-axiom Cid::from_bytes deletion + version-skew typed Stage::VersionPin tests (T3.4).

U4 — #78 assurance (scaffold, D-SA remains open):

Also:

  • docs/ideation/2026-08-31-excellent-declarative-experience.md 42 ideas across 6 frames → 39 survivors → top-7 (Reject as typed patch re-author loop, widening/taint as JSON, CID imports + hermetic check, preview as attenuated prod + CID chain, promotion as signed alias + ConfirmPolicy, palette + staged check, time-travel verify) — handoff declaration == bytes == CID.

Closes #63. Prepares #75, #58, #76, #78 per #74 dependency DAG.

Verification:
cargo test --workspace --all-targets --locked exit 0
cargo clippy --workspace --all-targets --locked -- -D warnings exit 0
cargo fmt --all -- --check exit 0
cargo metadata --locked exit 0
./scripts/braid-registry-export-check.sh exit 0 (twice, sha 1fac…)
./scripts/braid-release-probe.sh https://github.com/srinji-kaggss/Braid.git ca777aa exit 0 (afaa/cced/admit, remote)
./scripts/braid-release-probe.sh file:///Users/srinji/Braid <new HEAD> exit 0 (afaa/cced/admit, hermetic)
cargo test -p braid-flow-sdk --test source_equivalence/hostile_ron 1/1 passed

Adds closed enum JustificationGate { Enforced, Deferred { reason, required_by_version } } with strict canonical Value codec (INV-FLOW-019) ensuring Deferred never serializes as Enforced (disjoint wire shapes, single-key map, unknown-field fail-closed). Includes 10 unit tests covering round-trips, bijection via encode/decode_strict, and diagnostic rendering.

Records Director decision in spec/braid/DECISIONS.md as D-FLOW.13 (LOCKED 2026-08-31): v0 interop collapses to Read|Write, Safe x Authorized enforced, Justified deferred loudly with reason and future required_by_version, D-FLOW.6 Unknown-fails-closed unchanged, full AdmittedRead/Write lowering deferred.

Closes U1 of docs/plans/2026-08-31-002-next-workstream-prioritization.md.
Related: #63 #74 #75
…frames, 7 survivors

Grounding in Braid's verified substrate (IR/CID, 8-stage verifier, manifests, Flow/DLS elaborators) + external prior art (Dhall/Nix/Terraform/K8s/React/Lean). Axes: authoring surface, immediate feedback, composition & reuse, version & migration, review & deployment. Frames cover authoring seam, typed rejections, content-addressed composition, pins/CIDs, review as deployment, AI-native declarativeness.

Top-7 survivors: Reject as structured JSON re-author loop, widening/taint as structured diff, CID-pinned imports + hermetic check, preview as attenuated prod with CID chain, promotion as signed alias + ConfirmPolicy, palette + staged check, time-travel verify + outdated. 3 explicit rejections (ignore pragma, directory capsule, LSP now). Handoff: declaration == bytes == CID, rejection == typed patch, preview == attenuated prod, promotion == signed alias move — next ce-brainstorm slices S1+S2+S3 vs S4+S5.

Co-lane with ce-work U1 JustificationGate gate; plan at docs/plans/2026-08-31-002-next-workstream-prioritization.md.
…ile tests

Add braid-flow-sdk (workspace member, lgwks_std facade, no new external edge) owning the single authority for 16 MiB / depth 64 RON envelope checked before any AST allocation via allocation-free byte-scan (strings/comments skipped), plus declared node/edge/port/expansion bounds checked before Vec::try_reserve. Mirrors braid-flow-ir HARD_MAX_* and INV-FLOW-004/018.

JSON is interop/inspection-only (validate_json_source rejects unknown_field/__lossy/semantic_loss/float loss via closed ALLOWED_JSON_FIELDS), YAML is importer-only (import_gh_yaml envelope before parse). No verifier logic duplicated.

Tests (must-fail as must-refuse):
- tests/source_equivalence::unknown_and_lossy_sources_refuse (unknown/lossy/float ⇒ Malformed INV-FLOW-018, valid JSON admits)
- tests/hostile_ron::source_envelope_refuses_before_ast_allocation (MAX+1 bytes WireBytes, depth 65 PredicateDepth, quoted brackets ignored, boundary ok, bounds before reserve)

Verifies: cargo test -p braid-flow-sdk --test source_equivalence/hostile_ron green, cargo test -p braid-flow-sdk -p braid-cli -p braid-render --all-targets green, cargo test --workspace --all-targets green, clippy -D warnings green, fmt green.

Part of U5 docs/plans/2026-08-31-002-next-workstream-prioritization.md (R5, PB-04/PB-05 precedent).
Related: #58 #74
Audit shows MUTATION-LEDGER.md already covers 8/8 verifier stages (U9 T3/T5 + 6 NEW entries) with per-stage mutation + red test on semantic Admit-where-Reject-expected. Runtime budgets (#70 triad + #72 preflight) remain TODO. Scaffold docs/plans/evidence-U4-prep.md audits:

- Verifier stage coverage table (CanonicalForm, VersionPin, Structure, Types, Capability, Effect, Bounds, Taint) with ledger lines, acceptance.rs red tests, mutation locations
- keel-floor.sh diagnostic posture (exit 127 without KEEL_BIN, exit 2 UNMEASURED with local keel absent lanes.toml, no CI job per .github/workflows/ci.yml)
- calibration.rs RFC 8949 length-first map-ordering cross-check exists (queue #1 done)
- SAFETY_ASSURANCE_CI_SPEC.md corrected 2026-08-30 truthful, D-SA open
- Draft ledger extension for 2 runtime budgets + flight-hours placeholders (map-ordering done, Lean corpus todo)
- Verification receipts: cargo test -p braid-verify --all-targets 41 passed, cargo test -p braid-ir --test calibration 4 passed, workspace green, keel-floor diagnostic exits.

Keeps D-SA open per PB-01; hermetic Keel distribution + full Lean corpus generation remain blocked on native artifact (deliberate no-test exception).

Part of U4 docs/plans/2026-08-31-002-next-workstream-prioritization.md (R3, PB-01).
Related: #78 #74
@srinji-kaggss
srinji-kaggss merged commit 4b1b3e9 into main Aug 31, 2026
15 checks passed
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.

[P0.1 AMENDMENT] Collapse v0 interop to Read | Write; keep Justified as a loud future gate

1 participant