Skip to content

R3 P0 — FieldProject dual-authority dissolution (Class B; illegal-state-representable) - #2504

Merged
briansrls merged 20 commits into
mainfrom
session/bright-carp-806
May 10, 2026
Merged

briansrls merged 20 commits into
mainfrom
session/bright-carp-806

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session bright-carp-806.
Pushing to session/bright-carp-806 advances this PR.

Closes #2462

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

@briansrls
briansrls marked this pull request as ready for review May 10, 2026 00:59

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review metadata

  • Provider / model: codex / unknown
  • Commit: 311f7726 · Trigger: schedule
  • Thinking: 214s wall

BLOCKING (3)

Root Cause

  • src/v3/compiler/src/dag.rs 3544|ResolvedFieldProject is modeled as { field_ref: DeclarationId } only, so downstream re-derivation uses type equality instead of a stored field identity, which is not injective for duplicate-typed fields.
  • src/v3/compiler/src/dag.rs 3544|The dual-authority split drops field-label identity in the resolved state, so equivalence cannot distinguish provenance of a field_ref when multiple fields share the same type slot in a Conj.
  • src/v3/lenses/cost.dag 102|cost.dag defines entry_for with b.result_port and l.result_port and loop_cost(..., l.body); the generated file appears to have drifted from that authoritative source contract.

⚠️ The PR has blocking correctness issues in resolved field projection identity and symbolic-cost lens entry generation and should be fixed before landing.

@briansrls

Copy link
Copy Markdown
Contributor Author

Violations (could not place on specific lines):

  • src/v3/compiler/src/emit.rs:3689 This breaks ILLEGAL STATES UNREPRESENTABLE because resolved_field_project_label resolves label by children.iter().find(|field| field.ty == field_ref), so two distinct Conj fields with the same declaration type can map to the same projected label and emit the wrong field accessor.
  • src/v3/compiler/src/infer.rs:4024 This violates FACTS FLOW FORWARD and the “distinct facts” invariant because transform_targets_equal_under_subst treats resolved projections equal when their field_ref declarations are equivalent, ignoring source-field identity and allowing x.a and x.b (same type) to be conflated.
  • src/v3/compiler/src/lens_cost_symbolic_generated.rs:4400 This violates FACTS FLOW FORWARD in DB-3: entry_for now keys Branch/Loop entries by input/source, and loop_cost calls body_cost(..., &l.id), so lookups are generated for the wrong ports/nodes and can miss costs that dimension.rs expects at behavior result ports.

@briansrls
briansrls merged commit cea1fbe into main May 10, 2026
4 checks passed
@briansrls
briansrls deleted the session/bright-carp-806 branch May 10, 2026 02:17
briansrls added a commit that referenced this pull request May 10, 2026
#2537)

* docs(audit): SG-0 trajectory snapshot 2026-05-10 (+13 spike vs prior day)

PM standing daily-cadence duty per docs/audit/r3-sg0-trajectory-tracker.md §5.

Today (cea1fbe): non_test=53 test=108 fragments=2 total=163.
Delta vs 2026-05-09 baseline (150): +13 in one day, ~4× the 9-day avg of +3.3/day.

Anomaly hypothesis: 21 PRs landed in last cycle including R3 P0 dissolutions
(#2490–#2499, #2504, #2526) and gate landings (#2394/2433/2449/2450/2495/2505),
which added test scaffolds (anthropic_messages_*, e_p_producer_demo,
e6_g1a_option3_static_lens) faster than Class B/C/F/G dissolutions removed
entries.

Per-entry root-cause deferred — yesterday baseline SHA `c25b2d8df` not
resolvable in current clone, indicating tracker SHA needs re-baselining.

Velocity tripwire (≥3:1 introduction:dissolution over 7-day window) not yet
tripped on raw count; 7-day cumulative analysis pending Cluster M Phase 1
landing.

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

* docs(audit): soften tripwire status to pending/uncomputed (openai-pro feedback)

openai-pro NON-BLOCKING finding on PR #2537: the 2026-05-10 row claimed
the velocity tripwire was "not yet tripped" while also stating the
underlying 7-day ratio hadn't been computed yet. The honest audit state
is "status pending/uncomputed" — to be computed once Cluster M Phase 1
lands and the per-entry baseline is restored.

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

* docs(audit): correct +13 anomaly framing — real 1-day delta is +1

Per-entry root-cause investigation (deferred in prior commit) reveals the
+13 spike was a baseline-comparison artifact:

- 2026-05-09 tracker row recorded 150 mid-day (sha c25b2d8df, now stale)
- Actual 2026-05-09 EOD count was 162 (sha eb2cc15, last commit before
  2026-05-10 UTC) — 12 entries landed during the evening cycle (T-CostLens
  γ-ratification + R3 plan audit + 21-PR cycle) AFTER the tracker row was
  recorded
- 2026-05-10 vs 2026-05-09 EOD: +1 entry only (`anthropic_messages_wire_
  demo_test.rs` from PR #2506 [codex] add anthropic wire demo)

Updates:
- §3: split 2026-05-09 row into "(mid-day)" and "EOD" with retroactive
  correction; rewrite 2026-05-10 row with true +1 delta and cycle context
- §4: replace 4.3/day-with-spike framing with true 10-day window math;
  document the artifact correction

Velocity is steady, not anomalous. PB-0 closure trajectory continues on
the same trend; no escalation needed.

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

* docs(audit): preserve Director-receipted intermediate 2026-05-10 reading (f1588bc)

Discovered while doing post-snapshot velocity analysis: gentle-newt-665's
session branch (origin/session/gentle-newt-665, PR #2503, DRAFT) contains
commit 88e6fca with a Director-receipted SG-0 reading at sha f1588bc
(00:38Z, 2026-05-10) that never merged to main due to session archival.

Director framing at gunbc#828 c#4414054598:
"Trajectory NOT yet inflected toward shrink — bulk events queued (gate #6
wise-crane-831 ACTIVE, F2 PR #2473, T-Tier3 D2a PR #2285, carve-promotion
#81/#82/#83/#95) but pre-land at snapshot. Alarm 1 + Alarm 2 tripped on
extrapolation."

Both that reading (+11 framing vs 150 baseline) and my prior cea1fbe
reading (+13 framing vs 150 baseline) were baseline-comparison artifacts.
Against the corrected 2026-05-09 EOD baseline (162 entries):

- f1588bc (00:38Z): 161 = -1 entry net (marginal shrinkage; 1 fragment
  removed)
- cea1fbe (later): 163 = +1 entry net vs EOD baseline (anthropic wire
  demo PR #2506 added 1 test + restored 1 fragment)

§3 now records 5 date-stratified rows for honest day-history:
  2026-05-09 (mid-day) → 2026-05-09 EOD → 2026-05-10 (00:38Z, Director
  intermediate) → 2026-05-10 (later, current PM reading)

Preserves the Director's intermediate framing while correcting the
baseline artifact. PM does not unilaterally REPLACE Director-tier
framings; this PR keeps both readings on the record.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <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.

R3 P0 — FieldProject dual-authority dissolution (Class B; illegal-state-representable)

1 participant