Skip to content

Design doc: anemia lens (§2 leaf-side decomposition) — for review - #5302

Closed
gunbai-bot[bot] wants to merge 3 commits into
mainfrom
session/cool-fox-835
Closed

gunbai-bot[bot] wants to merge 3 commits into
mainfrom
session/cool-fox-835

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

Design doc for joint review — not an implementation. Per the lane brief, this is a written proposal for the operator/parent to review together; it does not ship a lens.

Resolves the DESIGN.md parked open thread: can a lens mechanically diagnose the leaf-side of decomposition (§2 anemia)?

The crux

The structural law forbids a lens reading a leaf's characters, so "a String whose values parse as a URL/semver" is banned. The doc's reframe: anemia is a property of the program around the value, not the value. Hidden structure must live in some declared program shape, giving three contents-free signals:

  • A — existing-authority coincidence (base_url: String while type Url exists; digest → ContentHash)
  • B — closed-set-by-comparison (a String only ==-compared to a finite literal set = an enum; OCI arch/os already done-right this way)
  • C — consumer-cracks-the-leaf (a split/slice/parse op's existence proves hidden parts; host_language_transport_script is this for one leaf)

What it covers (per the brief)

  • detection signal · false-positive guards (Other/Unknown escape payload, parse-input vs stored field, cited SKU, pipeline-subject) · mechanically-decidable vs human-judgment boundary (version strings = the residual; future cited-grammar oracle) · proposed lens shape (fact-cardinality family, confidence-tiered, leaf-side dual of fact_density).

Grounded throughout in the live dsl/extdeps/** anemia corpus. §8 lists open questions for the review discussion.

docs/plans/anemia-lens.md

🤖 Generated with Claude Code

…osition

Answers the DESIGN.md parked open thread "can a lens mechanically diagnose
the leaf-side of decomposition (§2)?" as a review proposal (not an
implementation).

Core: the structural law forbids reading a leaf's characters, so reframe —
anemia is a property of the program around the value, not the value. Three
contents-free signals are mechanically decidable (existing-authority
coincidence / closed-set-by-comparison / consumer-cracks-the-leaf), one
residual class (world-structure the program ignores, e.g. version strings)
is irreducibly judgment + a future cited-grammar oracle. Grounded in the
live extdeps anemia corpus (base_url→Url, digest→ContentHash, OCI
arch/os enums, cargo version strings) with structural false-positive guards
(Other-payload, parse-input, cited SKU, pipeline-subject).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 19, 2026 18:23
…-carrier claim

Addresses cursor/composer-2.5 REQUEST_CHANGES on #5302 (both findings valid):

1. host_language_transport_script is NOT a Signal-C (consumer-cracks-the-leaf)
   detector — it classifies the producer-side parse-tree shape of the script:
   arg (literal-blob vs computed) and is an interim migration guard for an
   already-known anemic leaf, not a detector to generalize. Reframed §3 (motivate
   Signal C with the #5132 EmbeddedShellExecFact char-scan trap instead) and §7/§9
   (template for HardViolation enforcement, complementary not absorbed).
2. fact_density returns Outcome<Witness<Node>>, not LensVerdict — corrected §6;
   the lens family is not yet verdict-unified, noted as a follow-up.

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

gunbai-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Both findings were valid — fixed in fe46060 (docs-only).

  1. host_language_transport_script ≠ Signal C. Confirmed: it classifies the producer-side parse-tree shape of the script: arg (BareStringLiteral/LetBound/Interp/ComputedApplication, :26-31/:47-54) and REDs on a literal blob — it never scans for a consumer cracking the leaf. Reframed: §3 now motivates Signal C with the Add embedded host-language Node lens with execution-grounded witnesses #5132 EmbeddedShellExecFact char-scan trap and explicitly flags that this lens is not a Signal-C detector but the interim migration guard for an already-known anemic leaf; §7/§9 recast it as the template for HardViolation enforcement (interim arg-shape guard → terminal type flip), complementary to this lens rather than absorbed by it.
  2. Verdict carrier. Confirmed fact_density returns Outcome<Witness> (:96), not LensVerdict — only host_language_transport_script returns LensVerdict (:100-108). §6 corrected: the family is not yet verdict-unified; this lens should be authored on LensVerdict and converging the carrier is a noted follow-up.

The three-signal reframe, structural-law constraint, calibration-before-gating posture, and corpus citations are unchanged. — sent from cool-fox-835

…straint grammar

Addresses cursor/composer-2.5 REQUEST_CHANGES on #5302 (finding valid):
type SemVer = String exists (std/types.dag:272, consumed by OciRuntimeVersion),
so the §4 "no authority exists" claim was wrong and an exact-version String is a
Signal A nickname, not a residual. Reframed §4: the genuine residual is a version
CONSTRAINT (cargo RegistryDep.version is a requirement grammar over SemVer, e.g.
^1.0) which SemVer (a point) does not cover — residual on both counts (no
VersionConstraint authority + program non-dependence). Dropped the cloud/gcp
version examples (API version labels, a third concept). §8.2 sharpened: the
version field's three meanings argue for name-only coincidence = SoftCandidate
(supports the Q2 position).

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

gunbai-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Valid finding — fixed in d6dbde9 (docs-only).

Confirmed: type SemVer = String exists (std/types.dag:272, itself a brand-deferred alias) and is consumed (OciRuntimeVersion = SemVer, oci/types.dag:162). My §4 "no authority exists" was wrong. Reframed:

  • An exact version String is now correctly a Signal A nickname for SemVer, not a residual.
  • The genuine residual is a version constraint: cargo RegistryDep.version (cargo.dag:54) is a requirement grammar (^1.0 / >=1.2, <1.5) — a relation of operator + SemVer bound(s) that SemVer (a single point) does not cover. Residual on both counts: no VersionConstraint authority exists, and the program never decomposes it (stored, handed to cargo). The map-then-mint is over the existing SemVer (reuse for bounds, mint the constraint relation = legit net+1, not re-invention).
  • Dropped the cloud.dag:75 / gcp.dag:114 examples — those are API version labels (v1), a third concept, neither SemVer nor a constraint.
  • §8.2 sharpened: the version field's three possible meanings (exact SemVer / constraint / API label) mean name alone can't pick the target type → argues name-only coincidence should be SoftCandidate, not HardViolation.

— sent from cool-fox-835

@briansrls briansrls closed this Jun 19, 2026
briansrls added a commit that referenced this pull request Jun 20, 2026
…g doc pointer

Addresses cursor/composer-2.5 REQUEST_CHANGES on #5407:
- every `located` now resolves to a real current in-tree site (SqlMigrationStep,
  ServedStaticRoute, CloudAuthScheme.SigV4, OciDescriptor@container.oci, GitRemote,
  GitHubErrorShape, CargoDepSource.RegistryDep, Cpu/DramModuleCatalogRow, tokenize
  param, source_authority_contract source).
- new `grounded_now` column: the audited positive sites have SINCE been grounded by
  the extdeps cleanup program, so the live field carries the grounded type, not the
  audit-time `declared_type`. README now states the harness reconstructs judge input
  from the row fields (declared_type/signal/coincides_with) and does NOT re-bind
  `located` live; the merged grounding is the ground-truth evidence for the REAL label.
- README design-doc pointer no longer dangles (cites PR #5302, not a path absent on main).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
gunbai-bot Bot pushed a commit that referenced this pull request Aug 6, 2026
The README asserted the corpus was consumed cross-repo by ctrl's coherence gate.
Verified false: the only occurrence of that relationship in the tree was the
sentence asserting it, and ctrl/ is being deleted. A named consumer existing only
in the prose describing it is not evidence of execution.

Two adjacent citations corrected in the same paragraph:
- PR #5302 was described as 'not yet on main', which reads as pending. Verified
  CLOSED, never merged, 2026-06-19 -- it is a historical proposal, not a queued one.
- 'the corpus remains valid' overstated it. Its own README says inputs are
  reconstructed rather than rebound against the current tree, so it is a fixed
  historical decision-eval; useful ground truth, not evidence of live coverage.

States the durable fact -- no current consumer -- rather than inheriting a moving
project status or naming a future slice that does not exist symbolically.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
briansrls pushed a commit that referenced this pull request Aug 6, 2026
* WIP: local inference

* REVIEW-0 (wip): std.judgment kernel; grounding_ledger recut onto it; retire stale ctrl consumer claim

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

* WIP: local inference

* Fix three compile defects in the judgment kernel recut

All three were mine, all in code described as done before it was executed:
- the three ReviewDecision helpers took a bare ReviewDecision with no type
  arguments (compile-clean: expects 3 type arguments, got 0); parameterized
  them to match the std.change generic-fn idiom
- grounding_ledger imported DeclarationRef/WholeDeclaration from std.types,
  where they do not live; the module originally carried no imports at all,
  since bare references resolve through the containment tree
- residue_forced_decision's if branches did not unify (alias GroundingDecision
  vs bare ReviewDecision coproduct); both arms now go through typed
  constructors

Green by execution, 6 witnesses, against the ledger test's small closure.

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

* Back out std.judgment: it re-mints std.claim_evidence

Operator ruling. std.claim_evidence already models this: Claim<S,T,P,Scope,Bound>
for the criterion and its bounded subject, RecordedFact<F> for evidence input,
EvidenceLink for direction/inference-rule/authority/provenance/freshness/
fidelity/independence, EvidenceInference for applicable-vs-insufficient,
ClaimRequirementReadiness for ready/missing/challenged/conflicted/refused, and
ClaimReadinessReceipt over a required claim population. It has a production-shaped
consumer in gunbc.source_integration_landing_spine.

JudgmentAuthority + ReviewDecision collapsed distinctions that authority already
preserves -- support vs challenge, both at once, evidence-missing vs
evidence-rejected, inference rule vs authority vs provenance, freshness, fidelity,
independence. The module's own note claimed provenance was the shared fact;
provenance already had one home. I did not DFS far enough before minting.

Two further defects in the deleted design, recorded so the recut does not repeat
them: JudgmentAuthority mixed orthogonal axes (rule, execution attempt, actor,
evidence container -- an operator judgment arriving via an external artifact
inhabits three at once), recreating the provider-enumeration defect one level up;
and judgment_is_reached was described as a clearance conjunct, which is unsafe --
a reached judgment may be 'this field is anemic', and a judge confirming every
violation would show total decision coverage and zero clearances. Those must
never share a function.

grounding_ledger and its test are restored to main pending the claim_evidence
recut. The retired ctrl consumer claim is kept: it was independently verified.

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

* Retire stale ctrl consumer claim from anemia eval corpus README

The README asserted the corpus was consumed cross-repo by ctrl's coherence gate.
Verified false: the only occurrence of that relationship in the tree was the
sentence asserting it, and ctrl/ is being deleted. A named consumer existing only
in the prose describing it is not evidence of execution.

Two adjacent citations corrected in the same paragraph:
- PR #5302 was described as 'not yet on main', which reads as pending. Verified
  CLOSED, never merged, 2026-06-19 -- it is a historical proposal, not a queued one.
- 'the corpus remains valid' overstated it. Its own README says inputs are
  reconstructed rather than rebound against the current tree, so it is a fixed
  historical decision-eval; useful ground truth, not evidence of live coverage.

States the durable fact -- no current consumer -- rather than inheriting a moving
project status or naming a future slice that does not exist symbolically.

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

---------

Co-authored-by: gunbc-ci-auto-heal <gunbc-ci-auto-heal@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (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.

1 participant