feat(baselines): generate the required floor without letting it shrink silently - #270
Open
Alan-TheGentleman wants to merge 3 commits into
Open
feat(baselines): generate the required floor without letting it shrink silently#270Alan-TheGentleman wants to merge 3 commits into
Alan-TheGentleman wants to merge 3 commits into
Conversation
…NTRACTS from the semantic snapshot Replace the hand-authored REQUIRED_OPERATIONS/REQUIRED_GATES/REQUIRED_PROJECTIONS and the 12-row NATIVE_CLI_CONTRACTS capability table with scripts/build-gentle-ai-baselines.mjs (--write/--check), which derives them from the checked-in semantic capability snapshot and capabilities/native-cli-history.json. The required floors regenerate monotonically -- a name can only be added; a name disappearing from the snapshot fails generation naming it, and un-requiring it needs a visible hand edit to the checked-in generated file. Mandatory-feature exactness and unmapped-operation detection are the same discipline applied to the two other places the design calls out: a mandatory feature Pi has no decoder for is never auto-added, and a provider operation with no NativeCliCapability column stops generation with an actionable message instead of silently appearing supported. The 12 pre-existing capability rows move verbatim into capabilities/native-cli-history.json; the currently pinned version's row is recomputed fresh each run and cross-checked against its own historical record, which self-verifies the generator against known-good data (--write reproduces the original 12 rows byte-identical).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fifth slice of the consumer chain, stacked on #269.
The paradox, and how it resolves
The spec wants
REQUIRED_*generated. The plan wants the floor frozen, so a removal stays visible. Those read as contradictory.Monotone regeneration resolves it.
--writemay ADD a required name. A name disappearing from the snapshot's required block makes generation fail naming it, and demands a hand-authored deletion from the generated file. A floor that silently follows the provider downward is not a floor.The mechanism is a self-referential fixed point: the generator regex-parses its own previously checked-in output as the baseline and unions it with the current snapshot. Un-requiring something needs a visible edit to a file marked "do not edit" — and that diff is the review signal.
Proven twice: as a pure-function test, and as a real subprocess run against a shrunk snapshot fixture, which fails with the exact operation name and the instruction to hand-edit.
Same discipline for mandatory features: an advertised one absent from Pi's supported set fails naming it and is never auto-added. Pi's supported set is a decision, not a mirror.
The 12 frozen rows moved verbatim
They describe already-released immutable versions and must never be recomputed. Their explanatory prose survives as
notesrather than being dropped.Two interpretations flagged rather than quietly closed
The task text says 13 of 17 capability flags map from the snapshot via
review.<op>. In practice only 5 map by exact operation name. The other 8 predate the negotiated contract and legitimately carry forward from history. That gap is documented rather than papered over with a lookup that would look derived but wouldn't be.REQUIRED_SCHEMASand the mandatory-feature constants stay hand-authored. The semantic snapshot mirror carries noschemasarray, and mandatory support is a client-code decision rather than something to mirror.Both deserve a reviewer's judgement, which is why they are here rather than in a commit footnote.
Tests
19 new, all green. The 7 pre-existing capability-contract regression locks still pass.
--checkclean,check:transaction-runnerclean with six generated modules now in sync.Full suite 1102 pass, 1 fail — the environmental no-network failure documented since #267, confirmed identical against the unmodified parent tip.
Rollback
Delete the five new files, revert the two library imports (the original hand-authored constants are fully preserved in the diff's removed lines), the sources entry, the CI step and the package scripts. No decoder, sync, installer or assets trust code is touched.