Skip to content

Commit 218b5fb

Browse files
openspec: repair three fissions that let a condition slip, and one scenario name (pass 10)
Council pass 10 (validation), seat gpt-5.6-sol, each reproduced by the coordinator against `git show 1a51102` before acting: 1. active-learning-decisions, "Activation is readiness-gated on every entry path": the clause "whenever the *resulting* document would be `active`" governed both SHALLs of the 532-char sentence; the fission left it on the evaluate-readiness half, so the PlanNotReady half read as refusing any incomplete document, drafts included. The clause is now repeated verbatim into the refusal fragment (381 chars). 2. active-learning-decisions, "A plan-related active primary carries one warm-up first move": the When-clause (plan-related, not the body double, active kind) governed derive AND carry; the carrier fragment lost it. Repeated verbatim (446 chars). 3. web-ui, "Plan with architect journey": lane B classed "Navigating away is **not** the abandon path: … a reload cannot kill a live session … the console reattaches … the End control abandons it" as rationale and moved it into a scenario. It is a negative guarantee and lifecycle behaviour the tests prove, so it returns to a body as its own requirement through a `modalise` (is -> be, SHALL inserted; 407 chars); the wrapper scenario is removed and "Leaving before the launch lands …" is homed under it. 4. data-store-and-sync: the test-sourced scenario said "every global table"; its test seeds six of the ten. Renamed to what the THEN already lists; the coverage gap is filed, not papered. Checker: a `split-sentence` entry may now declare `repeated_clause` — a verbatim clause of the fissioned sentence (sentence-initial capital aside) credited once per further fragment and reported as `clause-restated` for the reader; a clause the sentence never contained is refused (`split-sentence-clause-not-in-sentence`). `added_tokens` keeps refusing polarity words, which is what made the honest repair need a declaration of its own. 39 checker tests (one new, RED first). Whole tree: 0 fail, 29 warn, 452 drift entries. `just spec-check`: 26 passed, 0 failed.
1 parent 3353f87 commit 218b5fb

6 files changed

Lines changed: 152 additions & 26 deletions

File tree

‎openspec/.split-exceptions.toml‎

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,13 @@ reason = "One 532-char sentence: the four entry paths and the refusal. Split at
160160
old = "`apply` SHALL evaluate readiness whenever the *resulting* document would be `active` — create with `status=\"active\"` (`CreatePlan`), import of a document whose frontmatter says `active` (`ImportDocument`), replacement of an existing document with one whose frontmatter says `active` (`ReplaceDocument`), and a lifecycle transition to `active` (`TransitionLifecycle`) — and SHALL raise `PlanNotReady` carrying a `ReadinessView` **before any canonical write** when the plan has no mission `why`, no success criteria, or no milestones."
161161
new = [
162162
"`apply` SHALL evaluate readiness whenever the *resulting* document would be `active` — create with `status=\"active\"` (`CreatePlan`), import of a document whose frontmatter says `active` (`ImportDocument`), replacement of an existing document with one whose frontmatter says `active` (`ReplaceDocument`), and a lifecycle transition to `active` (`TransitionLifecycle`).",
163-
"`apply` SHALL raise `PlanNotReady` carrying a `ReadinessView` **before any canonical write** when the plan has no mission `why`, no success criteria, or no milestones.",
163+
"Whenever the *resulting* document would be `active`, `apply` SHALL raise `PlanNotReady` carrying a `ReadinessView` **before any canonical write** when the plan has no mission `why`, no success criteria, or no milestones.",
164164
]
165-
added_tokens = ["`apply`", "."]
165+
added_tokens = ["`apply`", ".", ","]
166+
repeated_clause = "whenever the *resulting* document would be `active`"
167+
# pass 10 (seat gpt-5.6-sol, reproduced by the coordinator): the clause governed both SHALLs in the
168+
# base sentence; without it the refusal fragment read as refusing any incomplete document, drafts
169+
# included. Repeated verbatim (sentence-initial capital), nothing else changed.
166170

167171
[[test-sourced]]
168172
spec = "active-learning-decisions"
@@ -447,9 +451,13 @@ reason = "One 502-char sentence: the condition + `derive one first move`, then `
447451
old = "When `build_now_plan` has ranked and applied the plan-backed guarantee, and the primary (and only the primary) is plan-related (carries a `PlanRef`), is not the body double, and is of an active kind — `action_type` in `hands-on`, `conversation`, `teachback` — `learning/decision.py::_warm_up` SHALL derive one first move on the primary's own material and carry it as `metadata[\"first_move\"]` (with `first_move_lesson_id`/`first_move_lesson_title` when a lesson resolved, exactly as on the body double)."
448452
new = [
449453
"When `build_now_plan` has ranked and applied the plan-backed guarantee, and the primary (and only the primary) is plan-related (carries a `PlanRef`), is not the body double, and is of an active kind — `action_type` in `hands-on`, `conversation`, `teachback` — `learning/decision.py::_warm_up` SHALL derive one first move on the primary's own material.",
450-
"`learning/decision.py::_warm_up` SHALL carry it as `metadata[\"first_move\"]` (with `first_move_lesson_id`/`first_move_lesson_title` when a lesson resolved, exactly as on the body double).",
454+
"When `build_now_plan` has ranked and applied the plan-backed guarantee, and the primary (and only the primary) is plan-related (carries a `PlanRef`), is not the body double, and is of an active kind — `action_type` in `hands-on`, `conversation`, `teachback` — `learning/decision.py::_warm_up` SHALL carry it as `metadata[\"first_move\"]` (with `first_move_lesson_id`/`first_move_lesson_title` when a lesson resolved, exactly as on the body double).",
451455
]
452456
added_tokens = ["`learning/decision", ".", "py", ":", ":", "_warm_up`", "SHALL", "."]
457+
repeated_clause = "When `build_now_plan` has ranked and applied the plan-backed guarantee, and the primary (and only the primary) is plan-related (carries a `PlanRef`), is not the body double, and is of an active kind — `action_type` in `hands-on`, `conversation`, `teachback` —"
458+
# pass 10 (seat gpt-5.6-sol, reproduced): the When-clause governed derive AND carry; the carrier
459+
# fragment without it read as unconditional. Repeated verbatim; `it` keeps its referent through the
460+
# heading ("the move") and the restated condition.
453461

454462
[[split-sentence]]
455463
spec = "active-learning-decisions"
@@ -796,7 +804,8 @@ reason = "Rework (ruling L5): states system behaviour (which tables every sync o
796804
[[test-sourced]]
797805
spec = "data-store-and-sync"
798806
heading = "Cross-machine sync — global tables travel in full, session-scoped tables are filtered to the delta"
799-
scenario = "A one-session delta still carries every global table"
807+
scenario = "A one-session delta still carries the global tables its fixture seeds"
808+
# pass 10 (seat gpt-5.6-sol): the test seeds six of the ten global tables; the name said "every"
800809
test = "packages/agent-session-tools/tests/test_sync.py::TestDumpDeltaSql::test_includes_durable_metadata_tables"
801810
reason = "Proves the global-tables sentence: a delta built for one session still carries an INSERT for every global table the test seeds (study_progress, study_sessions, teach_back_scores, knowledge_bridges, parked_topics, scrub_log) beside the session's own session_learning_metadata and file_references rows."
802811

@@ -1760,14 +1769,6 @@ scenario = "A click that beats the options fetch still starts exactly once"
17601769
test = "packages/studyloop/tests/test_web_plan_architect_journey.py::test_click_that_beats_the_options_fetch_still_starts_exactly_once[chromium]"
17611770
reason = "The bounded-wait fragment (council review 6); the test holds /api/session/options and asserts exactly one start POST after it resolves."
17621771

1763-
[[moved-body-text]]
1764-
spec = "web-ui"
1765-
heading = "Plan with architect journey"
1766-
ordinal = 14
1767-
text = '''Navigating away is **not** the abandon path: a closed socket detaches with a grace period by design, so an accidental reload cannot kill a live session — and a launch that lands *after* the learner has left the console is a session like any other (owner decision 2026-09-18, council review 6 F3b): it exists, it created no plan, the console reattaches to it on return, and the End control abandons it.'''
1768-
scenario = "Navigating away is not the abandon path"
1769-
reason = "Class: rationale / owner-decision note (no SHALL, 401 chars; explains why navigating away is not the abandon path — the behaviour itself is the abandon SHALL and the grace-period requirement elsewhere) between the abandon SHALL (#13, 294) and 'There is no cancel for a pending launch' (#15); with #13 it exceeds 500 and no other SHALL is adjacent. Homed as a scenario under the abandon fragment beside 'Leaving before the launch lands leaves a session like any other', which proves it."
1770-
17711772
# -- Plan list rows carry readiness and the sidebar marks a husk (812) -> 3 fragments
17721773

17731774
[[restates-shall]]
@@ -2062,3 +2063,14 @@ ordinal = 4
20622063
text = '''With this, every blocker `readiness()` can name — mission `why`, success criteria, milestones — is repairable with the tool the architect already holds, so `plan repair` is a repair rather than dictation.'''
20632064
scenario = "Why plan repair is a repair rather than dictation"
20642065
reason = "Class: rationale (why exposing the mission fields matters; no SHALL, tells the implementer nothing to do). Follows the gate sentence in the base and is homed as a scenario on the gate fragment, verbatim."
2066+
2067+
# ---- pass 10 (coordinator): web-ui 'Navigating away' returned from a scenario to a body ----
2068+
2069+
[[modalise]]
2070+
spec = "web-ui"
2071+
heading = "Plan with architect journey"
2072+
ordinal = 14
2073+
old = '''Navigating away is **not** the abandon path: a closed socket detaches with a grace period by design, so an accidental reload cannot kill a live session — and a launch that lands *after* the learner has left the console is a session like any other (owner decision 2026-09-18, council review 6 F3b): it exists, it created no plan, the console reattaches to it on return, and the End control abandons it.'''
2074+
new = '''Navigating away SHALL **not** be the abandon path: a closed socket detaches with a grace period by design, so an accidental reload cannot kill a live session — and a launch that lands *after* the learner has left the console is a session like any other (owner decision 2026-09-18, council review 6 F3b): it exists, it created no plan, the console reattaches to it on return, and the End control abandons it.'''
2075+
verb = ["is", "be"]
2076+
reason = "Pass 10 (seat gpt-5.6-sol, reproduced by the coordinator; overturns lane B's 'rationale' class): 'is **not** the abandon path', 'cannot kill a live session', 'the console reattaches', 'the End control abandons it' are a negative guarantee and lifecycle behaviour that the scenario 'Leaving before the launch lands leaves a session like any other' proves; pass 9 §4 Q2 keeps negative guarantees in bodies. Its own requirement (with the abandon SHALL it exceeds 500); the scenario lane B wrapped it in is removed and the proving scenario is homed here."

‎openspec/specs/active-learning-decisions/spec.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ lifecycle transition to `active` (`TransitionLifecycle`).
224224
- **THEN** all three succeed and `browse(status="active")` returns all three
225225

226226
### Requirement: Readiness gate — the refusal is PlanNotReady from one readiness function, before any write
227-
`apply` SHALL raise
227+
Whenever the *resulting* document would be `active`, `apply` SHALL raise
228228
`PlanNotReady` carrying a `ReadinessView` **before any canonical write** when
229229
the plan has no mission `why`, no success criteria, or no milestones. Readiness
230230
SHALL be computed by exactly one function (`authoring.readiness`), reached only
@@ -1339,7 +1339,10 @@ one first move on the primary's own material.
13391339
`Record evidence:`, once
13401340

13411341
### Requirement: Warm-up — the move rides as metadata first_move with the lesson fields, exactly as on the body double
1342-
`learning/decision.py::_warm_up` SHALL carry it as
1342+
When `build_now_plan` has ranked and applied the plan-backed guarantee, and
1343+
the primary (and only the primary) is plan-related (carries a `PlanRef`), is
1344+
not the body double, and is of an active kind — `action_type` in `hands-on`,
1345+
`conversation`, `teachback` — `learning/decision.py::_warm_up` SHALL carry it as
13431346
`metadata["first_move"]` (with `first_move_lesson_id`/`first_move_lesson_title`
13441347
when a lesson resolved, exactly as on the body double).
13451348

‎openspec/specs/data-store-and-sync/spec.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ every operation. Session-scoped tables (`sessions`, `messages`,
170170
`session_notes`, `session_tags`, `session_learning_metadata`,
171171
`file_references`) are filtered to only the delta session IDs.
172172

173-
#### Scenario: A one-session delta still carries every global table
173+
#### Scenario: A one-session delta still carries the global tables its fixture seeds
174174
- **WHEN** `_dump_delta_sql(db_path, {"test-session-001"})` builds the SQL
175175
for one session on a migrated database
176176
- **THEN** the SQL carries an `INSERT INTO` for `study_progress`,

‎openspec/specs/web-ui/spec.md‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -738,15 +738,13 @@ There is no cancel for a pending launch.
738738
- **WHEN** the learner activates the control and, as soon as the `201` arrives, uses the console's End control and confirms
739739
- **THEN** `GET /api/session/state` has no `study_session_id` and no planning purpose, `GET /api/plans` and the plans directory are unchanged, exactly one `study-session-start` fired, at most one WebSocket was opened, and no purpose label is visible
740740

741-
#### Scenario: Navigating away is not the abandon path
742-
- **WHEN** the learner leaves the console while a planning session is live or
743-
its launch is still in flight
744-
- **THEN** navigating away is **not** the abandon path: a closed socket detaches with a
745-
grace period by design, so an accidental reload cannot kill a live session —
746-
and a launch that lands *after* the learner has left the console is a session
747-
like any other (owner decision 2026-09-18, council review 6 F3b): it exists,
748-
it created no plan, the console reattaches to it on return, and the End
749-
control abandons it
741+
### Requirement: Plan with architect — navigating away is not the abandon path
742+
Navigating away SHALL **not** be the abandon path: a closed socket detaches with a
743+
grace period by design, so an accidental reload cannot kill a live session —
744+
and a launch that lands *after* the learner has left the console is a session
745+
like any other (owner decision 2026-09-18, council review 6 F3b): it exists,
746+
it created no plan, the console reattaches to it on return, and the End
747+
control abandons it.
750748

751749
#### Scenario: Leaving before the launch lands leaves a session like any other
752750
- **WHEN** the learner clicks "Plan with architect", the start POST is held,

‎packages/studyloop/tests/test_check_openspec_split.py‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,3 +2089,90 @@ def test_a_restated_lead_in_may_be_duplicated_across_fragments(checker, tmp_path
20892089
report = _run(checker, base, head)
20902090
assert report.ok, [(f.code, f.detail) for f in report.findings]
20912091
assert sum(1 for e in report.drift if e.kind == "lead-in-duplicated") == 2
2092+
2093+
2094+
def test_pass10_a_governing_clause_may_be_repeated_verbatim_into_a_fragment(
2095+
checker, tmp_path: Path
2096+
) -> None:
2097+
"""Pass 10 (seat gpt-5.6-sol, reproduced): a condition that governs a whole sentence
2098+
("Whenever the resulting document would be active, apply SHALL evaluate … and SHALL raise …")
2099+
was attached to the first fragment only, so the second fragment read as unconditional. The
2100+
repair repeats the clause; `added_tokens` refuses polarity words (`not`, `only`) by design, so a
2101+
clause containing them needs its own declaration: `repeated_clause`, which must be a verbatim
2102+
substring of the sentence (sentence-initial capitalisation aside) and lands in the drift report
2103+
as `clause-restated` for the reader."""
2104+
base, head = _pair(tmp_path)
2105+
_write_spec(
2106+
base,
2107+
"demo",
2108+
f"""
2109+
# demo Specification
2110+
## Purpose
2111+
A purpose someone wrote, long enough to clear the tool's minimum length for a purpose.
2112+
## Requirements
2113+
### Requirement: Gate
2114+
When not ready, the seam SHALL refuse the write and SHALL report the blockers.
2115+
{SCENARIO_OK}
2116+
""",
2117+
)
2118+
_write_spec(
2119+
head,
2120+
"demo",
2121+
f"""
2122+
# demo Specification
2123+
## Purpose
2124+
A purpose someone wrote, long enough to clear the tool's minimum length for a purpose.
2125+
## Requirements
2126+
### Requirement: Gate
2127+
When not ready, the seam SHALL refuse the write.
2128+
{SCENARIO_OK}
2129+
### Requirement: Gate — the blockers are reported
2130+
When not ready, the seam SHALL report the blockers.
2131+
#### Scenario: Blockers listed
2132+
- **WHEN** an unready plan is written
2133+
- **THEN** the refusal lists the blockers
2134+
""",
2135+
)
2136+
entry = """
2137+
[[split-sentence]]
2138+
spec = "demo"
2139+
heading = "Gate"
2140+
ordinal = 1
2141+
old = "When not ready, the seam SHALL refuse the write and SHALL report the blockers."
2142+
new = [
2143+
"When not ready, the seam SHALL refuse the write.",
2144+
"When not ready, the seam SHALL report the blockers.",
2145+
]
2146+
added_tokens = ["the", "seam", "."]
2147+
{clause}
2148+
2149+
[[restates-shall]]
2150+
spec = "demo"
2151+
heading = "Gate — the blockers are reported"
2152+
scenario = "Blockers listed"
2153+
restates = "When not ready, the seam SHALL report the blockers."
2154+
searched_tests = "none"
2155+
"""
2156+
# Declaring the polarity word as a plain added token is refused, as before.
2157+
_write_exceptions(
2158+
head,
2159+
entry.replace("{clause}", "").replace(
2160+
'"the", "seam", "."',
2161+
'"When", "not", "ready", ",", "the", "seam", "."',
2162+
),
2163+
)
2164+
report = _run(checker, base, head)
2165+
assert "split-sentence-token-drift" in _codes(report)
2166+
2167+
# The same words as a verbatim repeat of the sentence's own clause pass and are reported.
2168+
_write_exceptions(head, entry.replace("{clause}", 'repeated_clause = "When not ready,"'))
2169+
report = _run(checker, base, head)
2170+
assert report.ok, [(f.code, f.detail) for f in report.findings]
2171+
assert any(e.kind == "clause-restated" for e in report.drift)
2172+
2173+
# A clause the sentence never contained is not a repeat.
2174+
_write_exceptions(
2175+
head, entry.replace("{clause}", 'repeated_clause = "Unless the plan is ready,"')
2176+
)
2177+
report = _run(checker, base, head)
2178+
assert "split-sentence-clause-not-in-sentence" in _codes(report)

‎scripts/check-openspec-split.py‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,33 @@ def compare_spec(
589589
new_tok = Counter()
590590
for s in news:
591591
new_tok += _tokens(s)
592-
drift = (new_tok - old_tok) - allowed
592+
# A clause that governed the whole sentence (a conditional or ordering
593+
# lead-in inside the sentence) may be repeated verbatim into the fragments
594+
# that lost it; only a substring of the sentence qualifies, and the clause
595+
# may appear at most once per fragment beyond the copy the sentence had.
596+
clause = _norm(exc.data.get("repeated_clause", ""))
597+
clause_tok: Counter[str] = Counter()
598+
if clause:
599+
sentence = _norm(exc.data.get("old", unit))
600+
variants = {
601+
clause,
602+
clause[:1].lower() + clause[1:],
603+
clause[:1].upper() + clause[1:],
604+
}
605+
if not any(v in sentence for v in variants):
606+
report.fail(
607+
"split-sentence-clause-not-in-sentence",
608+
spec,
609+
f"[{heading} #{ordinal}] repeated_clause is not a clause of the "
610+
f"sentence: {clause}",
611+
)
612+
found = [next((v for v in variants if v in s), None) for s in news]
613+
# the sentence already paid for one copy; every further fragment that
614+
# carries the clause is credited the tokens of the form it carries
615+
for v in [v for v in found if v is not None][1:]:
616+
clause_tok += _tokens(v)
617+
report.note("clause-restated", spec, heading, f"[{ordinal}] {clause}")
618+
drift = (new_tok - old_tok) - allowed - clause_tok
593619
missing = old_tok - new_tok
594620
# connective words may be dropped by a fission (and/, /;) — nothing else
595621
missing -= Counter(
@@ -1205,7 +1231,7 @@ def _materialise_base(repo: Path, rev: str) -> Path:
12051231

12061232

12071233
def main(argv: list[str] | None = None) -> int:
1208-
ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
1234+
ap = argparse.ArgumentParser(description=(__doc__ or "").split("\n\n")[0])
12091235
ap.add_argument("--base", help="git revision holding the pre-split openspec/ tree")
12101236
ap.add_argument(
12111237
"--base-dir", type=Path, help="pre-split openspec/ directory (instead of --base)"

0 commit comments

Comments
 (0)