Skip to content

Judge a submitted plan before anything records it - #306

Merged
crenshawdev merged 26 commits into
mainfrom
demerzel
Oct 30, 2026
Merged

crenshawdev merged 26 commits into
mainfrom
demerzel

Conversation

@crenshawdev

Copy link
Copy Markdown
Owner

Build 4 T8. Baley can now judge a plan whole before anything records it. The judge is pure core and takes everything from outside the plan as plain values, so T9's plan submit can run it over the phase's records. Nothing records, serves or approves a plan yet, that's T9.

What changed:

  • A new judge in crates/baley-core/src/plan/ refuses a submitted plan whole, the first fault in a fixed order answering. An unknown key, a missing member, a wrong type or a malformed lease is typed-content naming the entry by its path. The plan number, question set, size and suite are Baley's to write at approval, so a plan carrying any of them is refused too.
  • Every lease entry is a plain relative path: not absolute, no backslash, no trailing separator, no empty, . or .. part, no duplicates, at most 256 declarations across files and directories. A task file outside the lease is lease.
  • Each evidence item names its story as well as its truth and version, since a truth id is unique only within its story. Each check carries a level, unit or integration, a boundary and its fakes, and a blank command, expected value, test file or boundary is refused under its own code. check-boundary is new.
  • Coverage is judged over the phase as it would stand with the plan approved, its items plus the approved plans' items: uncovered-truth, truth-without-check, truth-check-limit for a second check on one truth version, and the new truth-without-observation for a truth a person must see live with no observation item. An item id reused with another definition is evidence-item-conflict, and a link whose value its truth doesn't name is link-value-not-named.
  • With planning.phase_capacity set, a plan that takes the phase over it is refused over-capacity, naming every story the plan serves and the size the phase would reach. Each plan's tasks count once, so a plan serving two stories isn't counted twice, and the owner picks which story waits.
  • The plan's questions field is judged by the question set judge, its codes passed through.
  • The planner's text is served by identity as bal-phase-planner, ported from Cadence v3.9.0's planner contract, plan workflow and plan template, with design 0005's test rules word for word and the default test style, which is its own constant now. It holds no number but the grammar limits, and a test fails if one is added. The bal-plan front door is ported too, and still answers unavailable until T9 serves it with its operations.
  • Designs 0005 and 0012, the glossary and the roadmap match the code. The roadmap shows T7 merged and T8 in progress.

How it was verified: a second model reviewed every plan's diff. Two fixes came out of it and they're in this PR: the planner text no longer asks for "Running X shows Y" verify entries, since Baley runs each one as written, and the design's Terms row now says a task can carry more than one verify command. Each acceptance check has a recorded failing run, before its behavior was built or with it broken. All 4,122 workspace tests, clippy, fmt and cargo deny pass. A debug build's baley serve, driven over stdio in a throwaway home, served bal-phase-planner with the hash pinned in the code and refused bal-plan as unavailable.

Known limits: nothing calls the judge yet, T9's plan submit is the first. The planner text doesn't tell the planner it gets the approved plans' evidence items, which coverage is judged across, since T9 names the planning order's inputs. Refusals have no details() yet, and T9 adds it when plan submit answers with them.

A submitted plan needs one pure entry point that judges it against the
phase's facts before anything records it. This adds the plan module, the
facts T9 fills, the refusal type and the accepted plan, and reads each of
the plan's ten members in a fixed order, keeping every text as written.
Baley writes the plan number, question set, size and suite at approval,
so a plan naming one, or any other unknown member, is refused before any
member is read. Phase and story numbers must fit the counters they name,
and a story served twice is named where it repeats.
Every lease entry must be a plain relative path, declared once, within
the 256-declaration limit, and a lease must declare something. The path
rule and the inside-the-lease test are public so the later risk check and
the lease check at close read the same path set.
Each task is read whole at its place in the member walk, so its faults
answer before later members are judged: exact members, a unique id and at
least one verify command with none blank. A task file outside the lease
is the one case refused `lease`.
The plan's questions field is the same kind of set an analyzer returns,
so it is judged by `judge_set` and its refusal is passed on with its code
and positions unchanged. The accepted plan keeps the accepted set.
Each item names its story, truth and version and carries a spec typed by
its kind. A check's spec holds its level, boundary and fakes, and a check
with no level or another one is out of grammar, so every check T9 records
can be run at either level.
…or boundary

A check that names nothing to run, nothing to expect, no test file or no
boundary cannot prove its truth, so each is refused under its own code at
either level. The new `check-boundary` code sits beside the other three;
a blank setup, call or test function has no code and is accepted.
… story

A plan for a phase nobody refined has nothing to prove, and a plan
serving a story the phase never committed would plan work outside it.
Both are judged on the phase's committed stories alone, after the plan's
own grammar, lease and check fields.
An item names its truth by story, id and version, since a truth id is
unique only within its story; step (7) refuses an item naming no current
truth of a served story or another version of it.
A link's value must be a delimited token of one slot of its truth, so a
value inside a word, across two slots or blank names nothing; step (9)
refuses it as link-value-not-named.
…nition

Coverage is judged over the phase's plans together, so one item id must
mean one item across them; step (8) compares the whole item and names the
approved plan that differs.
…the phase

A plan serving a story need not prove again what an approved plan already
proves, so steps (10) and (11) judge the union of the approved plans'
items with this plan's, by story, truth and current version.
A truth with human_verify cannot be proven by mocked checks alone, so
step (12) asks the phase's items for an observation of its current
version, after step (11) has asked for its one check.
Exactly one check proves a truth version across the phase, so step (13)
counts distinct check ids over the approved plans' items and this plan's,
an id listed again unchanged counted once, and names every one found.
A phase's size counts each plan's tasks once, so step (14), last, adds
this plan's task count to the current size in a wider integer and names
every story the plan serves; the owner picks which waits.
The planner and the executor both receive it when a project has set no
test style, so it lives in one place both can reuse.
The planner needs the plan grammar the judge holds, every refusal it can
meet, section 10's test rules and the default test style, ported from
Cadence with no number for it to aim at.
T9 serves it with phase plan, plan submit and plan read, so the door is
ported now with every dropped Cadence step listed beside it and stays
unavailable until then.
Baley runs each verify entry as written, so the retained "Running X
shows Y" form would launch a program named Running. The text now asks
for the bare command and puts the expected output in the action or a
check's expected. Version 1 has not shipped, so its hash is re-pinned.
Design 0005's terms and requirements now match the core plan judge: a
phase's size counts each plan's tasks once, over-capacity names every
served story and the size reached, the lease path rule and the members
Baley writes at approval are stated, an evidence item names its story,
and PLN-R13 gains check-boundary and truth-without-observation.
Section 6 now says which plan members the planner submits and which
Baley writes at approval, gives the evidence item its story and each
spec kind its members as the core judge reads them, and ties a
human_verify truth to an observation item. Figure 5's over-capacity
refusal names every served story and the size the phase would reach.
Section 10 names bal-phase-planner, the default test style's constant
and the ported bal-plan text, which stays unavailable until Build 4 T9
serves it. Section 11 moves PLN-R4, R5, R9, R11 to R13, R17 to R19 and
R27 off the parked engine onto the core plan module and the served
text, citing ADR 0042 for each check's level, boundary and fakes.
Design 0012 names the planner's text as a work-order instruction with
no help row, gives its identity, and adds it to HST-R11's served
texts with its pins, beside bal-plan's compiled text that stays
unavailable until Build 4 T9. The count of texts with no help row is
corrected to the six the list holds.
The roadmap's status, Figure 5 and task table move T7 to merged as
#296 and T8 to in progress, the Cadence sources line names v3.9.0 for
T8's planner and bal-plan texts, and a T8 paragraph says what the plan
judge and the planner's served text deliver.
The Terms row said a task has one verify command, while PLN-R11, the
tasks record and the core task judge allow one or more.
The glossary still called a phase's size the sum over its stories, which counts a plan serving two stories twice.
@crenshawdev
crenshawdev merged commit 12f61df into main Oct 30, 2026
5 checks passed
@crenshawdev
crenshawdev deleted the demerzel branch October 30, 2026 23:04
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