Skip to content

Add three-tier thinking room posture contract - #542

Merged
flyingrobots merged 13 commits into
mainfrom
lane/0027-three-tier-thinking-room
Jun 13, 2026
Merged

Add three-tier thinking room posture contract#542
flyingrobots merged 13 commits into
mainfrom
lane/0027-three-tier-thinking-room

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

Refs #538.

This PR lands PLATFORM-0027 and the first implementation tranche for Echo's three-tier thinking room model. It makes causal/revelation posture explicit instead of treating retained work as implicitly shared.

Changes:

  • Approves docs/design/0027-three-tier-thinking-room/design.md with the amended posture, authority, admission-scope, promotion, legacy-derivation, import, and materialization requirements.
  • Renames the domain posture model to CausalPosture with a deprecated RevelationPosture compatibility alias.
  • Adds the minimal authority substrate: origin, actor, authority domain refs, authority bindings, seal strength, capability proof, and posture derivation.
  • Adds validated RetentionPosture and SessionContext constructors so Shared requires an AdmissionScopeId and non-shared posture cannot carry one.
  • Adds explicit materialization and promotion/admission primitives, including shared admission projections that do not reveal sealed source chains by default.
  • Adds import posture disposition so source-shared material stays pending local admission until a local scope exists.
  • Adds a constructor posture lint and wires it into verify-local pattern guards.

Validation

Passed locally:

  • cargo fmt --all -- --check
  • git diff --check
  • scripts/check-no-app-nouns-in-core.sh
  • cargo check -p warp-core
  • cargo test -p warp-core --lib revelation::tests
  • cargo test -p warp-core --lib
  • cargo clippy -p warp-core --lib -- -D warnings
  • scripts/check-causal-posture-constructors.sh
  • bash scripts/tests/causal_posture_constructor_lint_test.sh
  • bash -n scripts/check-causal-posture-constructors.sh scripts/tests/causal_posture_constructor_lint_test.sh scripts/verify-local.sh
  • scripts/check_spdx.sh scripts/check-causal-posture-constructors.sh scripts/tests/causal_posture_constructor_lint_test.sh scripts/verify-local.sh
  • scripts/verify-local.sh ultra-fast
  • scripts/verify-local.sh full

Known unrelated local baseline:

  • cargo clippy -p warp-core --all-targets -- -D warnings is blocked by existing test-target lints, tracked as warp-core all-targets clippy is blocked by existing test-target lints #541.
  • VERIFY_LOCAL_HOOK_TESTS=1 scripts/verify-local.sh full is blocked locally by unrelated hook-test/tooling baselines and missing local Node packages under Node v26; normal scripts/verify-local.sh full passes.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced causal authority and posture model with explicit witness-based admission controls for enhanced visibility and access management
    • Added validation framework for retention and session context
  • Refactor

    • Migrated core posture handling to new model with authority binding and capability proof support

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@flyingrobots, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 17 minutes and 23 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4506781a-6235-48de-8962-6885d811331c

📥 Commits

Reviewing files that changed from the base of the PR and between 580fdc4 and 2fd319e.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • crates/warp-core/src/coordinator.rs
  • crates/warp-core/src/lib.rs
  • crates/warp-core/src/provenance_store.rs
  • crates/warp-core/src/revelation.rs
  • crates/warp-core/src/settlement.rs
  • docs/design/0027-three-tier-thinking-room/design.md
  • scripts/check-causal-posture-constructors.sh
  • scripts/tests/causal_posture_constructor_lint_test.sh
📝 Walkthrough

Walkthrough

Migrates posture handling from RevelationPosture to CausalPosture (Scratch/AuthorOnly/Shared) across revelation, braid-shell, and settlement modules. Introduces authority identifiers, witness-bound admission/materialization receipts, and import disposition types. Adds PLATFORM-0027 design specification and constructor linting enforcement.

Changes

CausalPosture core and authority modeling

Layer / File(s) Summary
CausalPosture contract and identifier types
crates/warp-core/src/revelation.rs
CausalPosture enum (Scratch/AuthorOnly/Shared) with no global Default; hash_id! macro generating opaque identifiers (OriginId, ActorId, AuthorityDomainId, AdmissionScopeId, RetentionContractId, IntentId, AdmissionId, etc.); authority/retention/session types (CausalAuthority, RetentionPosture, SessionContext) with constructor validation; PostureObstruction updated to use CausalPosture variants.
Promotion, admission, and materialization
crates/warp-core/src/revelation.rs
WitnessDigest rejecting shrug digests; MaterializationReceipt enforcing Scratch→AuthorOnly transitions; PromotionIntent/SharedAdmission with witnessed shared admission, projection policies, and source-disclosure policies; ImportAdmissionReceipt/ImportPostureDisposition for import scoping; least_revealed and shell_posture_obstruction updated to CausalPosture parameters.
Revelation test coverage
crates/warp-core/src/revelation.rs
Tests for CausalPosture ordering, canonical tags, least_revealed behavior, shell_posture_obstruction invariants, promotion validation (witnessed vs. unwitnessed), authority coherence, materialization requirements, and import disposition behavior.

Braid shell posture threading

Layer / File(s) Summary
Braid shell type updates
crates/warp-core/src/braid_shell.rs
BraidShellMember::posture, BraidShell::posture, BraidShell::assemble(posture), BraidShellReplay::posture, and BraidShellQuery::posture field types migrate to CausalPosture; digest/witness helpers fold posture canonical tag into hash computation.
Braid shell test fixtures
crates/warp-core/src/braid_shell.rs
All test construction and shell assembly updated to use CausalPosture::AuthorOnly; replay, tampering, floor violation, coherence, lineage, and canonical-set tests updated; query-matching tests filter by CausalPosture.

Settlement and public API

Layer / File(s) Summary
Settlement posture updates
crates/warp-core/src/settlement.rs
PluralAlternativeDraft::posture field type and to_abi conversion migrate to CausalPosture; braid-shell member construction and plural-draft initialization set posture to CausalPosture::AuthorOnly; test assertions and rollback dummy shell updated.
Public API surface
crates/warp-core/src/lib.rs
RevelationPosture re-exported separately with #[allow(deprecated)]; revelation re-export list expanded to include CausalPosture, authority/identifier types, admission/materialization receipts, import dispositions, and helpers; promote_posture and PosturePromotion removed from public re-exports.

Design and enforcement

Layer / File(s) Summary
PLATFORM-0027 design specification
docs/design/0027-three-tier-thinking-room/design.md
Defines causal posture model, authority substrate and coherence, retention posture bundle, session/strand creation contracts, promotion/admission/materialization doctrines, import scoping and quarantine namespaces, determinism/DIND constraints; specifies acceptance criteria, RED test plan, implementation slices A–I.
Constructor enforcement
scripts/check-causal-posture-constructors.sh, scripts/tests/causal_posture_constructor_lint_test.sh, scripts/verify-local.sh
Lint script using ripgrep to forbid CausalPosture Default impl/derives, CausalPosture::default( calls, and RetentionPosture/SessionContext struct literals. Regression test script with negative fixtures validating enforcement. Integration into verify-local.sh.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

Suggested labels

tooling

Poem

Three tiers of posture rise—Scratch, AuthorOnly, Shared—
Witnesses bound the climb, authorities declare the rules,
No silent sharing, no default escapes,
Linters guard the gates: determinism demands it. 🔐

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title accurately describes the main change: migration from RevelationPosture to CausalPosture and implementation of PLATFORM-0027 three-tier thinking room posture contract design.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lane/0027-three-tier-thinking-room

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex review please

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f40e8047de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-causal-posture-constructors.sh Outdated
Comment thread crates/warp-core/src/revelation.rs
Comment thread crates/warp-core/src/revelation.rs
Comment thread crates/warp-core/src/revelation.rs
@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex please confirm or challenge this self-review.

Self-Code Review Findings

Severity File Lines Infraction Recommended mitigation prompt
P1 crates/warp-core/src/revelation.rs 776-806; crates/warp-core/src/lib.rs 319-328 promote_posture remains public/re-exported and can create a PosturePromotion to Shared with only a WitnessDigest. That bypasses the new PLATFORM-0027 rule that shared admission requires authority, scope, and an intent. This is especially dangerous because the helper name reads like a generic posture promotion API. "Add a RED test proving promote_posture(CausalPosture::AuthorOnly, CausalPosture::Shared, witness) cannot be used as shared admission. Then either make promote_posture private/shell-local, rename it to a non-admission shell widening helper, or make to == Shared require the same authority/scope/intent path as PromotionIntent::admit_shared."
P1 crates/warp-core/src/revelation.rs 431-443, 484-498, 585-604 Authority proofs are accepted by category only. MaterializationReceipt::new and PromotionIntent::admit_shared store authorized_by, but AuthorityResolutionProof::LocalAuthorityDomain(other_domain) still authorizes because the proof is never checked against authorized_by or source authority. A mismatched proof can mint a receipt naming an authority it did not prove. "Add regression tests where authorized_by and AuthorityResolutionProof::LocalAuthorityDomain(...) differ and assert materialization/promotion is rejected. Then make authority authorization take the claimed AuthorityDomainRef and validate equality for local-domain proofs; keep delegation/key/import proof resolution explicit for later verifier-backed cases."
P1 crates/warp-core/src/revelation.rs 689-710 import_posture_disposition returns LocallyAdmittedShared solely because local_admission_scope is Some. That turns a scope lookup into an admission act without an import/admission intent, authority proof, or witness. It recreates the "shared elsewhere means shared here" trap the design explicitly rejects. "Replace local_admission_scope: Option<AdmissionScopeId> with an explicit import/admission receipt or intent proof for the locally admitted case. Add a RED test showing imported source-shared material with a known scope but no local admission receipt remains SourceSharedPendingAdmission."
P2 crates/warp-core/src/revelation.rs 621-650 SourceDisclosurePolicy::RevealNone is not enforceable on SharedAdmission because every admission always exposes source_strand: StrandId. Observers can learn the exact sealed source id even when the policy says reveal none. That is metadata disclosure. "Introduce a SealedSourceRef / AdmissionSourceDisclosure shape so RevealNone does not expose the source strand id on the shared projection. Add a test that a shared admission with RevealNone can expose projection digest/scope while withholding the sealed source id from the shared view."
P2 crates/warp-core/src/revelation.rs 215-231, 257-271 RetentionPosture::new validates only admission scope. It permits impossible legacy derivations such as causal_posture: AuthorOnly with posture_derivation: LegacyDurableAssumedShared, which erases the audit value of PostureDerivation. "Add derivation/posture invariant tests and reject mismatches: LegacyDurableAssumedShared must pair with Shared, LegacyEphemeralAssumedScratch must pair with Scratch, and imported/session/debugger/counterfactual derivations should have explicit allowed posture rules or documented Any semantics."
P2 crates/warp-core/src/revelation.rs 200-213, 257-271 CausalAuthority is public raw data with no constructor or coherence check. RetentionPosture::new accepts an authority whose origin_id, author_domain.origin_id, and AuthorityBinding::LocalUnbound { origin } disagree. That allows structurally impossible authority records before full identity exists. "Add CausalAuthority::new with origin/domain/binding coherence validation and make RetentionPosture::new consume only validated authority. Add RED tests for mismatched local origin, mismatched author-domain origin, and imported-unresolved authority rules."
P3 scripts/tests/causal_posture_constructor_lint_test.sh 43-65 The lint regression only proves raw RetentionPosture literals are rejected. It does not prove the guard catches raw SessionContext, CausalPosture::default(), impl Default for CausalPosture, or derive(Default) regressions even though the script claims those responsibilities. "Extend scripts/tests/causal_posture_constructor_lint_test.sh with temporary fixtures for raw SessionContext, CausalPosture::default(), impl Default for CausalPosture, and #[derive(Default)] pub enum CausalPosture, and assert each fixture is rejected."

Count

  • P1: 3
  • P2: 3
  • P3: 1
  • P4/P5: 0

Style witnesses run during review:

  • git diff --check origin/main...HEAD
  • pnpm exec markdownlint-cli2 docs/design/0027-three-tier-thinking-room/design.md
  • scripts/check-causal-posture-constructors.sh

All three passed; findings above are semantic/structural.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f40e8047de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/warp-core/src/revelation.rs Outdated
Comment thread crates/warp-core/src/revelation.rs
Comment thread crates/warp-core/src/revelation.rs Outdated
Comment thread crates/warp-core/src/revelation.rs Outdated
Comment thread crates/warp-core/src/revelation.rs
Comment thread crates/warp-core/src/revelation.rs Outdated
Comment thread scripts/check-causal-posture-constructors.sh Outdated
Comment thread crates/warp-core/src/revelation.rs
Comment thread crates/warp-core/src/revelation.rs Outdated
@flyingrobots

Copy link
Copy Markdown
Owner Author

Resolved the seven self-review findings in 580fdc4c (fix: harden causal posture authority guards).

Resolution map:

Finding Resolution
P1 public shared promotion bypass Removed promote_posture/PosturePromotion from the crate re-export and made the helper test-only; raw widening to Shared now returns SharedAdmissionRequiresIntent in the regression witness.
P1 authority proof not bound to authorized_by AuthorityResolutionProof::authorizes_new_admission now validates local authority proofs against the operation authority; materialization and promotion reject mismatched proof authorities.
P1 imported shared admitted from scope alone Added ImportAdmissionReceipt; import_posture_disposition only returns LocallyAdmittedShared when a validated receipt is present.
P2 RevealNone leaks source id Added AdmissionSourceDisclosure; RevealNone produces Hidden, so the shared projection can carry digest/scope without exposing the sealed source strand id.
P2 legacy derivation can lie RetentionPosture::new now validates derivation/posture coherence for legacy/debugger/counterfactual derivations.
P2 authority coherence unchecked Added CausalAuthority::new and coherence validation for origin/domain/binding; RetentionPosture::new and SessionContext::new validate authority coherence.
P3 lint regression under-covered Expanded causal_posture_constructor_lint_test.sh to cover raw SessionContext, CausalPosture::default(), impl Default, and derive(Default).

Local validation after the fix:

  • cargo fmt --all -- --check
  • git diff --check
  • pnpm exec markdownlint-cli2 docs/design/0027-three-tier-thinking-room/design.md
  • scripts/check-no-app-nouns-in-core.sh
  • scripts/check_spdx.sh crates/warp-core/src/lib.rs crates/warp-core/src/revelation.rs docs/design/0027-three-tier-thinking-room/design.md scripts/tests/causal_posture_constructor_lint_test.sh
  • cargo check -p warp-core
  • cargo test -p warp-core --lib revelation::tests
  • cargo test -p warp-core --lib
  • cargo clippy -p warp-core --lib -- -D warnings
  • bash scripts/tests/causal_posture_constructor_lint_test.sh
  • scripts/check-causal-posture-constructors.sh
  • scripts/verify-local.sh full

Pre-push also passed exact Rust slices and Prettier on the pushed tree.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
scripts/tests/causal_posture_constructor_lint_test.sh (1)

121-127: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Test coverage: add false-positive verification.

The tests verify that violations are correctly rejected, but don't verify that valid constructor usage (e.g., RetentionPosture::new(...) and SessionContext::new(...)) is NOT flagged. Add positive test cases to prevent false positives.

🧪 Suggested additional test fixtures
+echo ""
+echo "3. Valid constructor usage is not rejected"
+valid_retention_fixture="${tmpdir}/valid-retention.rs"
+cat >"${valid_retention_fixture}" <<'RS'
+fn valid_fixture() {
+    let _posture = RetentionPosture::new(
+        causal_posture,
+        posture_derivation,
+        authority,
+        retention_contract,
+        admission_scope,
+    );
+}
+RS
+
+assert "RetentionPosture::new is allowed" \
+  env CAUSAL_POSTURE_LINT_PATHS="${valid_retention_fixture}" "${guard}"
+
+valid_session_fixture="${tmpdir}/valid-session.rs"
+cat >"${valid_session_fixture}" <<'RS'
+fn valid_fixture() {
+    let _session = SessionContext::new(
+        session_id,
+        origin_id,
+        actor_id,
+        author_domain,
+        authority_binding,
+        seal_strength,
+        default_posture,
+        default_admission_scope,
+        retention_contract,
+    );
+}
+RS
+
+assert "SessionContext::new is allowed" \
+  env CAUSAL_POSTURE_LINT_PATHS="${valid_session_fixture}" "${guard}"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/tests/causal_posture_constructor_lint_test.sh` around lines 121 -
127, Current tests only assert that bad constructor usages are flagged; add
positive test cases that include valid constructor calls like
RetentionPosture::new(...) and SessionContext::new(...) so the linter does NOT
report them. Update the test fixtures used by
scripts/tests/causal_posture_constructor_lint_test.sh to include files with
correct usages of RetentionPosture::new and SessionContext::new, ensure the test
runner treats those files as expected-passing cases (incrementing the passed
count and not the failed count), and run the existing comparison logic so false
positives are caught in future changes.
crates/warp-core/src/settlement.rs (1)

273-307: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Persist plural posture in the retained record, not just the draft/ABI.

PluralAlternativeDraft now carries posture and to_abi() exports it, but append_plural_artifact() still records only ProvenanceEventKind::PluralArtifact { plural_id }. After settlement, the retained provenance entry no longer contains the posture, so replay/query code cannot reconstruct it from stored data. Persist the posture in the retained artifact schema or bind it into the retained record/digest.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/warp-core/src/settlement.rs` around lines 273 - 307, Plural posture is
exported by PluralAlternativeDraft::to_abi but not persisted: update the
retained provenance record so the posture is stored (rather than only recording
ProvenanceEventKind::PluralArtifact { plural_id }). Modify the
ProvenanceEventKind::PluralArtifact variant (or the retained-artifact schema) to
include a posture field, update append_plural_artifact() to write that posture
from the PluralAlternativeDraft when creating the retained entry, and adjust any
serialization/digest functions (and ABI conversion paths) that construct or
validate retained plural records so the persisted entry and its digest include
the posture.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/warp-core/src/revelation.rs`:
- Around line 773-808: ImportAdmissionReceipt can be replayed across different
imports because it lacks an import-specific identifier; add a field (e.g.,
import_id: ImportId or ImportedArtifactId) to the ImportAdmissionReceipt struct,
update ImportAdmissionReceipt::new to accept and store that identifier (and keep
existing authority_proof.authorizes_new_admission call), change
import_posture_disposition() to require receipt.import_id == current_import_id
(rather than merely Some(receipt)) before returning LocallyAdmittedShared, and
add a regression test asserting a receipt minted for import A does not admit
import B; apply the same field/check where ImportAdmissionReceipt is
constructed/consumed in the other affected sites.
- Around line 1390-1413: The test currently checks only
AuthorityResolutionProof::LocalAuthorityDomain but misses the nested case where
AuthorityResolutionProof::LocalCapability(CapabilityProof::LocalAuthorityDomain(...))
names a different authority; add a test (or extend
promotion_rejects_mismatched_authority_proof) that calls
PromotionIntent::admit_shared with
AuthorityResolutionProof::LocalCapability(CapabilityProof::LocalAuthorityDomain(...))
using an AuthorityDomainRef/AuthorityDomainId that differs from
fixture_authority_ref(), and assert it returns
Err(PostureObstruction::AuthorityProofMismatch { authorized_by:
fixture_authority_ref() }) so the nested mismatch path in the admit_shared
authority check is covered (use the same IntentId/ActorId/strand/posture/etc. as
the existing test to mirror the scenario).

In `@docs/design/0027-three-tier-thinking-room/design.md`:
- Around line 75-102: Current Truth in design 0027 has a stale anchor for Design
0026: update the anchor reference so the 0027 "Current Truth" paragraph points
to the actual section in Design 0026 that contains the "echo#538 / E0-lite lands
as E1’s first commit" text (rather than the blank line currently linked); leave
the other snapshots and claims unchanged (RevelationPosture,
promote_posture/WitnessDigest, Strand, ForkBasisRef, and Session v1 observations
are correct).

In `@scripts/check-causal-posture-constructors.sh`:
- Around line 59-62: Update the regex passed to check_rg so it also treats '[' ,
'=>' and 'return' as valid delimiters before struct-literal occurrences of
RetentionPosture and SessionContext; in other words, extend the leading-token
group (currently (^|[=(:,]\s*)) to include an optional '\[' token, a '=>' token,
and 'return' followed by whitespace so the pattern still matches
'([A-Za-z0-9_]+::)*(RetentionPosture|SessionContext)\s*\{' but will also catch
cases like '[ ... {', '... => {', and 'return ... {' as an extra hardening; keep
the rest of the pattern and flags unchanged.

---

Outside diff comments:
In `@crates/warp-core/src/settlement.rs`:
- Around line 273-307: Plural posture is exported by
PluralAlternativeDraft::to_abi but not persisted: update the retained provenance
record so the posture is stored (rather than only recording
ProvenanceEventKind::PluralArtifact { plural_id }). Modify the
ProvenanceEventKind::PluralArtifact variant (or the retained-artifact schema) to
include a posture field, update append_plural_artifact() to write that posture
from the PluralAlternativeDraft when creating the retained entry, and adjust any
serialization/digest functions (and ABI conversion paths) that construct or
validate retained plural records so the persisted entry and its digest include
the posture.

In `@scripts/tests/causal_posture_constructor_lint_test.sh`:
- Around line 121-127: Current tests only assert that bad constructor usages are
flagged; add positive test cases that include valid constructor calls like
RetentionPosture::new(...) and SessionContext::new(...) so the linter does NOT
report them. Update the test fixtures used by
scripts/tests/causal_posture_constructor_lint_test.sh to include files with
correct usages of RetentionPosture::new and SessionContext::new, ensure the test
runner treats those files as expected-passing cases (incrementing the passed
count and not the failed count), and run the existing comparison logic so false
positives are caught in future changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e509e18f-3a23-4469-9d22-b4136c407679

📥 Commits

Reviewing files that changed from the base of the PR and between a0af251 and 580fdc4.

📒 Files selected for processing (9)
  • crates/warp-core/src/braid_shell.rs
  • crates/warp-core/src/lib.rs
  • crates/warp-core/src/provenance_store.rs
  • crates/warp-core/src/revelation.rs
  • crates/warp-core/src/settlement.rs
  • docs/design/0027-three-tier-thinking-room/design.md
  • scripts/check-causal-posture-constructors.sh
  • scripts/tests/causal_posture_constructor_lint_test.sh
  • scripts/verify-local.sh

Comment thread crates/warp-core/src/revelation.rs
Comment thread crates/warp-core/src/revelation.rs
Comment thread docs/design/0027-three-tier-thinking-room/design.md
Comment thread scripts/check-causal-posture-constructors.sh Outdated
@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex Activity Summary for the Code Lawyer repair pass.

# Severity Source File Commit Outcome
1 P1 PR / CodeRabbit crates/warp-core/src/revelation.rs 64e42ae1 Bound ImportAdmissionReceipt to ImportedArtifactId; a receipt for import A no longer admits import B.
2 P1 PR / Codex crates/warp-core/src/revelation.rs 315abe89 Sealed MaterializationReceipt, PromotionIntent, and ImportAdmissionReceipt fields behind constructors plus accessors.
3 P3 PR / CodeRabbit scripts/check-causal-posture-constructors.sh cf92910b Guard now catches indented tail, return, bracket, and match-arm raw literals.
4 P3 PR / CodeRabbit scripts/tests/causal_posture_constructor_lint_test.sh cf92910b Added valid RetentionPosture::new and SessionContext::new false-positive fixtures.
5 P1 PR / CodeRabbit crates/warp-core/src/settlement.rs; crates/warp-core/src/provenance_store.rs; crates/warp-core/src/coordinator.rs d24cda44 Persisted plural artifact posture in ProvenanceEventKind::PluralArtifact and folded posture into event-kind hashing.
6 P5 PR / CodeRabbit crates/warp-core/src/revelation.rs 43997d73 Added nested LocalCapability(LocalAuthorityDomain(..)) authority-mismatch regression.
7 P3 PR / CodeRabbit docs/design/0027-three-tier-thinking-room/design.md 59a3a2d7 Corrected the Design 0026 posture anchor from #L67 to #L72.
8 P1 Prior self-review / PR crates/warp-core/src/revelation.rs; crates/warp-core/src/lib.rs 580fdc4c Removed public shared raw-promotion bypass and blocked raw widening to Shared without PromotionIntent.
9 P1 Prior self-review / PR crates/warp-core/src/revelation.rs 580fdc4c Bound local authority proofs to authorized_by; legacy shared authority cannot authorize new admission.
10 P2 Prior self-review / PR crates/warp-core/src/revelation.rs 580fdc4c Added derivation/posture and authority-coherence validation for retention/session posture constructors.

Resolved review threads via GraphQL after push: 9. Active unresolved review threads after resolution: 0.

Validation:

Witness Result
git status --porcelain clean before repair, clean before push
git diff --check origin/main...HEAD pass
cargo test -p warp-core --lib pass, 537 tests
scripts/verify-local.sh full pass (fmt, guards, clippy-core, tests-warp-core)
pre-push hook pass (cargo fmt, full warp-core --lib, targeted provenance_store, revelation, settlement, Prettier)

Note: an exploratory cargo check -p warp-core --features serde remains blocked by pre-existing unrelated serde gaps in optic.rs / observation types and was not part of this PR gate.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • No code changes were made. The trigger is an activity summary stating the repair pass already resolved the reviewed issues and left zero active unresolved review threads.
  • I did not create a commit or PR because I made no changes, and the repository already had an uncommitted pnpm-lock.yaml modification present at first inspection.
  • I followed the repo context protocol by checking docs/BEARING.md for current direction and METHOD.md for work doctrine. docs/BEARING.mdL48-L65 METHOD.mdL27-L43

Testing / Checks

  • git diff --check && scripts/check-causal-posture-constructors.sh
  • git status --porcelain
  • git log -n 5 --oneline
  • ⚠️ find backlog/asap -maxdepth 2 -type f -print | sort | sed -n '1,80p' — warned because backlog/asap does not exist in this checkout; METHOD.md indicates live backlog has moved to GitHub Issues and legacy filesystem backlog lives under docs/method/backlog/. METHOD.mdL27-L43

View task →

@flyingrobots
flyingrobots merged commit cfccf67 into main Jun 13, 2026
36 checks passed
@flyingrobots
flyingrobots deleted the lane/0027-three-tier-thinking-room branch June 13, 2026 19:32
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