Skip to content

CAP1-01: bounded OpenUI grammar/scope state graph and exact continuation quotient#333

Closed
Tyler-R-Kendrick wants to merge 8 commits into
mainfrom
slm-81-cap1-01-state-graph
Closed

CAP1-01: bounded OpenUI grammar/scope state graph and exact continuation quotient#333
Tyler-R-Kendrick wants to merge 8 commits into
mainfrom
slm-81-cap1-01-state-graph

Conversation

@Tyler-R-Kendrick

Copy link
Copy Markdown
Owner

Implements the bounded OpenUI state graph over the choice-codec owner, adds the openui-cap-v1 fixture profile, and records measured results.

  • Exact fixture run: raw=171, minimized=26, transitions=13333, status=EXACT.
  • Larger/partial profiles report UNKNOWN with work/coverage evidence.
  • Adds regression tests for fingerprinting, forced-suffix collapse, replay, and serialization.

Closes SLM-81.

- Add slm_training.dsl.analysis.arity package with immutable
  AnalysisBounds, StateAtom, StateSignature, ArityReport, and SupportOracle.
- Implement AST canonicalization stable under binding/placeholder renaming.
- Add bounded explorer and ArityAnalyzer emitting versioned, digestible reports.
- Add scripts/analyze_grammar_arity.py CLI and pyproject.toml entry point.
- Add tests/test_dsl/test_arity_analysis.py regression tests for
  reproducibility, renaming invariance, and conservative support decisions.
- Document in docs/design/cap0-02-arity-analyzer.md and note repository owner.
- Configure Linear MCP in .mcp.json for issue workflow.

Caveats: partial-prefix continuation BFS is scaffolded; the prior '86 raw
frontier states' claim is not reproduced or retired here. No model/ship claim.
…e functions (SLM-79)

- Add src/slm_training/dsl/analysis/arity/coding.py with verified
  constructions and exact coding-theory bounds (Singleton, Hamming,
  Gilbert-Varshamov, Hamming ball volume, exhaustive code verification).
- Add build_mds_7_4_2_3 and build_shortened_ternary_hamming_7_4_3 with
  exhaustive distance checks.
- Add src/slm_training/dsl/analysis/arity/precision.py with strict
  margin predicate, ternary ECOC width, and ResidualScaleMode guard.
- Export public symbols from slm_training.dsl.analysis.arity.
- Add tests/test_dsl/test_arity_coding.py covering MDS/ternary
  constructions, Singleton rejection of q=6, strict margin regression,
  ECOC detection, and scale-mode guards.
- Document in docs/design/cap0-03-coding-precision.md.

Caveats: fixture/wiring evidence only; no model/ship claim.
A_3(6,3)=38 is an external exact bound, not locally verified here.
…bust arms (SLM-79)

- Add CodingMetadata dataclass to ArityReport with bound/construction,
  proof status, source citation, utilization, and scale-mode fields.
- Add suggest_robust_arms helper that excludes disproven (K=6,d=4) and
  (K=3,d=6) arms and keeps verified (K=7,d=4) MDS and ternary n=7 arms.
- Wire --include-coding-metadata flag into analyze_grammar_arity CLI.
- Add tests for report metadata serialization/digest and suggestion filtering.
- Update docs/design/cap0-03-coding-precision.md.

Honest caveat: ternary d=7/d=8 slack arms are not emitted because no
locally verified construction is available; only the verified [7,4,3]_3
shortened Hamming arm is suggested.
…ware reports (SLM-80)

- Add certificate.py with EvidenceKind, ConstraintFrame, ExactEvidence,
  EstimatedEvidence, ArityResult, ArityProvenance, ArityCertificate,
  ArityCertificateBundle, and deterministic digests.
- Enforce validation rules: EXACT_LOCAL needs witness, EXACT_EXTERNAL needs
  source URI, ESTIMATED needs positive sample count and provenance.
- Add render.py with Markdown, CSV, and one-line summary renderers.
- Extend analyze_grammar_arity CLI with --certificate, --out-md, --out-csv,
  --one-line, and provenance flags.
- Add exact_certificate_from_report helper that classifies reports as
  exact-local when a verified construction is present, otherwise unknown.
- Add tests/test_dsl/test_arity_certificate.py with 10 regression tests
  covering validation, JSON round-trip, digest stability, and renderers.
- Add docs/design/cap0-04-arity-certificates.md and cross-links from
  cap0-02/cap0-03 docs.

Honest caveat: fixture/wiring evidence only; no model, checkpoint, or
ship-quality claim.
…tinuation quotient

- Add AnalysisProfile and openui-cap-v1 fixture profile.
- Implement StateGraph over ChoiceDecodeState with deterministic forced-suffix
  collapse, canonical StateFingerprint, and bottom-up minimization.
- Wire --dsl-pack/--profile/--representation CLI path in
  scripts/analyze_grammar_arity.py.
- Add regression tests for exact/unknown profiles, alpha-equivalence,
  scope-future distinction, forced-suffix collapse, replay, serialization,
  and over-merged fingerprints.
- Record measured results in docs/design/iter-cap1-01-state-graph-20260717.md.
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
slm-training Ready Ready Preview, Comment Jul 17, 2026 11:37pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a6e8aa9e-87a0-4943-98e5-27d0381979b8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch slm-81-cap1-01-state-graph

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.

Copy link
Copy Markdown
Owner Author

Status: needs a fresh CAP1-01 re-implementation (can't be adapted as-is)

I've landed CAP0-03 (#327) and CAP0-04 (#330) onto main's canonical arity API, and attempted to adapt CAP1-01 here — but it isn't cleanly portable, and I won't corrupt main to force it.

The named deliverable — "bounded OpenUI grammar/scope state graph and enumeration" — is this branch's 724-line dsl/analysis/arity/state_graph.py, which is a divergent rewrite that collides with main's canonical dsl/analysis/arity/state_graph.py (from #354). They share only the filename: main's module is bounded arith-sketch enumeration → prefix trie (enumerate_programs/build_trie/Trie/EnumerationBounds); this branch's is StateGraph.explore() over an OpenUI AnalysisProfile. Merging the branch's version would revert #354's canonical state_graph.

The only stub-free, self-contained file, arity/profiles.py, is an orphan config dataclass with no consumer on main — and the branch's test, design doc, and CLI hook all bind to the divergent StateGraph, so none of them are runnable/reproducible on main. Shipping profiles.py alone would deliver an unused struct while dropping the entire named capability.

What's needed: a fresh CAP1-01 implementation authored against main's canonical state_graph/report/certificate API — likely as a new, distinctly-named module (to avoid the state_graph.py collision) — with its own test and a reproducible design doc. That's net-new engineering beyond a fork adaptation, so I'm leaving this open for that rework rather than force-merging a canonical revert. #336 (CAP2-01) builds on this and is blocked by the same issue.

No stub was reintroduced, no canonical file reverted, and no test weakened.


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Correction to my note above: CAP2-01 (#336) turned out not to depend on CAP1-01 after all. Its only real dependency is CAP0-03's coding constructions (build_mds_7_4_2_3 / build_shortened_ternary_hamming_7_4_3) plus a self-contained model; the --state-report reference is an optional duck-typed JSON (needs only a minimized_states integer). It has been adapted and merged separately (#336).

So only CAP1-01 (this PR) still needs the fresh re-implementation described above — nothing else in the CAP chain is blocked on it. CAP0-03 (#327), CAP0-04 (#330), CAP2-01 (#336), and CAP3-01 (#338) are all merged onto main's canonical arity API.


Generated by Claude Code

@Tyler-R-Kendrick

Copy link
Copy Markdown
Owner Author

Closing as superseded by main. SLM-81 is already Done and main now contains the bounded state-graph/analyzer package under src/slm_training/dsl/analysis/arity/ along with the associated fixtures. This branch retains additional cap0-* design docs that can be cherry-picked in a follow-up if still needed.

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