@christang/keel 5.58.0 → 5.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.59.0",
|
|
4
4
|
"description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TanglmChris",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.59.0",
|
|
4
4
|
"description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TanglmChris",
|
|
@@ -37,8 +37,8 @@ REQUIRED_SCRIPTS = [
|
|
|
37
37
|
"scripts/validate_plugin.py",
|
|
38
38
|
]
|
|
39
39
|
|
|
40
|
-
PACKAGE_VERSION = "5.
|
|
41
|
-
PROTOCOL_VERSION = "5.
|
|
40
|
+
PACKAGE_VERSION = "5.59.0"
|
|
41
|
+
PROTOCOL_VERSION = "5.59.0"
|
|
42
42
|
LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
|
|
43
43
|
OPENSPEC_SCHEMA_NAME = "keel-spec-driven"
|
|
44
44
|
# Mirrors KEEL_PACKAGE_NAME in scripts/install_to_repo.py, one of the two
|
|
@@ -26606,6 +26606,215 @@ def validate_evidence_survives_what_did_not_change_scenario() -> int:
|
|
|
26606
26606
|
return 0
|
|
26607
26607
|
|
|
26608
26608
|
|
|
26609
|
+
# 5.55.0 built the way out of a blanket "all of it is stale" and signed it
|
|
26610
|
+
# nowhere a reader would look: issue #134 grepped the installed package and
|
|
26611
|
+
# found `--keep-evidence` only in its own two refusals, so the population told
|
|
26612
|
+
# it exists is exactly the population already using it. One use in 67 task
|
|
26613
|
+
# capsules, against a median re-verification of 256 s. Every exit that tells an
|
|
26614
|
+
# author their evidence is stale now names it — and none of them names which
|
|
26615
|
+
# checks it would apply to, because the gate keeps only the previous
|
|
26616
|
+
# fingerprint and cannot know.
|
|
26617
|
+
def validate_staleness_report_names_its_exception_scenario() -> int:
|
|
26618
|
+
label = "a-staleness-report-names-its-exception"
|
|
26619
|
+
flag = "--keep-evidence"
|
|
26620
|
+
|
|
26621
|
+
def fixture(root: Path, name: str) -> Path:
|
|
26622
|
+
repo = root / name
|
|
26623
|
+
task = strategy_probe_task(
|
|
26624
|
+
strategy="evidence-first",
|
|
26625
|
+
reason="fixture; nothing here can fail first",
|
|
26626
|
+
commands=(
|
|
26627
|
+
"M1: the first check asserts the public behavior",
|
|
26628
|
+
"M2: the second check asserts the public behavior",
|
|
26629
|
+
"M3: the third check asserts the public behavior",
|
|
26630
|
+
),
|
|
26631
|
+
)
|
|
26632
|
+
# A recorded anchor that is not the compiled one, so every exit fires.
|
|
26633
|
+
task = task.replace(
|
|
26634
|
+
" - Contract: pending",
|
|
26635
|
+
" - Contract: keel-task-capsule/v1 sha256:" + "0" * 64,
|
|
26636
|
+
)
|
|
26637
|
+
write_gate_fixture(repo, tasks=task)
|
|
26638
|
+
return repo
|
|
26639
|
+
|
|
26640
|
+
def keel_json(repo: Path, *args) -> dict:
|
|
26641
|
+
result = run_keel(repo, *args)
|
|
26642
|
+
try:
|
|
26643
|
+
return json.loads(result.stdout)
|
|
26644
|
+
except json.JSONDecodeError:
|
|
26645
|
+
return {"status": "unparsed", "problems": [
|
|
26646
|
+
{"code": "unparsed", "message": result.stdout[:300]}
|
|
26647
|
+
]}
|
|
26648
|
+
|
|
26649
|
+
def message_for(payload: dict, code: str) -> str:
|
|
26650
|
+
for entry in payload.get("problems") or []:
|
|
26651
|
+
if str(entry.get("code", "")) == code:
|
|
26652
|
+
return str(entry.get("message", ""))
|
|
26653
|
+
return ""
|
|
26654
|
+
|
|
26655
|
+
# The suggestion has to carry the flag's own contract, not just its name:
|
|
26656
|
+
# when it applies, and that the claim is the author's to defend.
|
|
26657
|
+
def states_the_condition(text: str) -> bool:
|
|
26658
|
+
return "assertion" in text.lower()
|
|
26659
|
+
|
|
26660
|
+
def sends_the_reason_home(text: str) -> bool:
|
|
26661
|
+
return "Reauthorizations" in text
|
|
26662
|
+
|
|
26663
|
+
def names_a_check(text: str) -> str:
|
|
26664
|
+
return next((m for m in ("M1", "M2", "M3") if m in text), "")
|
|
26665
|
+
|
|
26666
|
+
with tempfile.TemporaryDirectory(prefix="keel-names-exception-") as raw:
|
|
26667
|
+
root = Path(raw)
|
|
26668
|
+
|
|
26669
|
+
# Exit 1 of 3 — `task-start --record` with no declaration. This is the
|
|
26670
|
+
# branch issue #134 names, and the only one whose reader is mid-record.
|
|
26671
|
+
blanket = keel_json(
|
|
26672
|
+
fixture(root, "blanket"), "gate", "task-start", "--change", "demo",
|
|
26673
|
+
"--task", "1.1", "--json", "--no-guard", "--record",
|
|
26674
|
+
)
|
|
26675
|
+
if blanket.get("status") != "pass":
|
|
26676
|
+
report(
|
|
26677
|
+
f"{label}: the re-record fixture did not pass, so no "
|
|
26678
|
+
f"stale-evidence report was produced; {problem_text(blanket)!r}."
|
|
26679
|
+
)
|
|
26680
|
+
return 1
|
|
26681
|
+
warned = " ".join(str(x) for x in (blanket.get("warnings") or []))
|
|
26682
|
+
if flag not in warned:
|
|
26683
|
+
report(
|
|
26684
|
+
f"{label}: the blanket stale-evidence report does not name "
|
|
26685
|
+
f"{flag}, so an author who has not already used it re-verifies "
|
|
26686
|
+
f"everything; {warned!r}."
|
|
26687
|
+
)
|
|
26688
|
+
return 1
|
|
26689
|
+
if not states_the_condition(warned):
|
|
26690
|
+
report(
|
|
26691
|
+
f"{label}: the blanket report names {flag} without saying when "
|
|
26692
|
+
f"it applies — that the check's assertion did not move; "
|
|
26693
|
+
f"{warned!r}."
|
|
26694
|
+
)
|
|
26695
|
+
return 1
|
|
26696
|
+
if not sends_the_reason_home(warned):
|
|
26697
|
+
report(
|
|
26698
|
+
f"{label}: the blanket report names {flag} without saying the "
|
|
26699
|
+
f"reason belongs in Reauthorizations, where it can be "
|
|
26700
|
+
f"disagreed with; {warned!r}."
|
|
26701
|
+
)
|
|
26702
|
+
return 1
|
|
26703
|
+
named = names_a_check(warned)
|
|
26704
|
+
if named:
|
|
26705
|
+
report(
|
|
26706
|
+
f"{label}: the blanket report names {named} while suggesting "
|
|
26707
|
+
f"{flag}. The gate keeps only the previous fingerprint and "
|
|
26708
|
+
f"cannot know which checks are unaffected; {warned!r}."
|
|
26709
|
+
)
|
|
26710
|
+
return 1
|
|
26711
|
+
|
|
26712
|
+
# Exit 2 of 3 — `task-complete`'s contract-drift refusal, which already
|
|
26713
|
+
# prints the command the flag belongs to.
|
|
26714
|
+
completing = fixture(root, "completing")
|
|
26715
|
+
done = keel_json(
|
|
26716
|
+
completing, "gate", "task-complete", "--change", "demo",
|
|
26717
|
+
"--task", "1.1", "--json",
|
|
26718
|
+
)
|
|
26719
|
+
drift = message_for(done, "contract-drift")
|
|
26720
|
+
if not drift:
|
|
26721
|
+
report(
|
|
26722
|
+
f"{label}: the drifted fixture did not produce a "
|
|
26723
|
+
f"contract-drift refusal; {problem_codes(done)!r}."
|
|
26724
|
+
)
|
|
26725
|
+
return 1
|
|
26726
|
+
if "keel gate task-start --record" not in drift:
|
|
26727
|
+
report(
|
|
26728
|
+
f"{label}: the contract-drift refusal stopped naming the "
|
|
26729
|
+
f"reauthorization command, which is what makes the flag "
|
|
26730
|
+
f"belong in it; {drift!r}."
|
|
26731
|
+
)
|
|
26732
|
+
return 1
|
|
26733
|
+
if flag not in drift:
|
|
26734
|
+
report(
|
|
26735
|
+
f"{label}: the contract-drift refusal does not name {flag} "
|
|
26736
|
+
f"even though it names the command that accepts it; {drift!r}."
|
|
26737
|
+
)
|
|
26738
|
+
return 1
|
|
26739
|
+
if not states_the_condition(drift):
|
|
26740
|
+
report(
|
|
26741
|
+
f"{label}: the contract-drift refusal names {flag} without "
|
|
26742
|
+
f"saying when it applies; {drift!r}."
|
|
26743
|
+
)
|
|
26744
|
+
return 1
|
|
26745
|
+
named = names_a_check(drift)
|
|
26746
|
+
if named:
|
|
26747
|
+
report(
|
|
26748
|
+
f"{label}: the contract-drift refusal names {named} while "
|
|
26749
|
+
f"suggesting {flag}; {drift!r}."
|
|
26750
|
+
)
|
|
26751
|
+
return 1
|
|
26752
|
+
|
|
26753
|
+
# Exit 3 of 3 — the context drift hard-stop, which already says to
|
|
26754
|
+
# re-run task-start and record the new anchor.
|
|
26755
|
+
blocked = keel_json(fixture(root, "blocked"), "context", "--json")
|
|
26756
|
+
reasons = " ".join(str(x) for x in (blocked.get("reasons") or []))
|
|
26757
|
+
if blocked.get("status") != "blocked":
|
|
26758
|
+
report(
|
|
26759
|
+
f"{label}: the drifted fixture did not block context, so the "
|
|
26760
|
+
f"drift hard-stop did not fire; {blocked.get('status')!r}."
|
|
26761
|
+
)
|
|
26762
|
+
return 1
|
|
26763
|
+
if "drift" not in reasons.lower():
|
|
26764
|
+
report(
|
|
26765
|
+
f"{label}: context blocked for something other than the "
|
|
26766
|
+
f"contract drift this fixture builds; {reasons!r}."
|
|
26767
|
+
)
|
|
26768
|
+
return 1
|
|
26769
|
+
if flag not in reasons:
|
|
26770
|
+
report(
|
|
26771
|
+
f"{label}: the context drift hard-stop does not name {flag} "
|
|
26772
|
+
f"even though it tells the reader to re-record the anchor; "
|
|
26773
|
+
f"{reasons!r}."
|
|
26774
|
+
)
|
|
26775
|
+
return 1
|
|
26776
|
+
if not states_the_condition(reasons):
|
|
26777
|
+
report(
|
|
26778
|
+
f"{label}: the context drift hard-stop names {flag} without "
|
|
26779
|
+
f"saying when it applies; {reasons!r}."
|
|
26780
|
+
)
|
|
26781
|
+
return 1
|
|
26782
|
+
named = names_a_check(reasons)
|
|
26783
|
+
if named:
|
|
26784
|
+
report(
|
|
26785
|
+
f"{label}: the context drift hard-stop names {named} while "
|
|
26786
|
+
f"suggesting {flag}; {reasons!r}."
|
|
26787
|
+
)
|
|
26788
|
+
return 1
|
|
26789
|
+
|
|
26790
|
+
# The already-narrowed report does not repeat the suggestion. Absence
|
|
26791
|
+
# is also what a broken narrowing produces, so the positive control
|
|
26792
|
+
# runs first: the branch has to be alive before its silence means
|
|
26793
|
+
# anything.
|
|
26794
|
+
narrowed = keel_json(
|
|
26795
|
+
fixture(root, "narrowed"), "gate", "task-start", "--change", "demo",
|
|
26796
|
+
"--task", "1.1", "--json", "--no-guard", "--record",
|
|
26797
|
+
"--keep-evidence", "M1,M3",
|
|
26798
|
+
)
|
|
26799
|
+
narrowed_said = " ".join(str(x) for x in (narrowed.get("warnings") or []))
|
|
26800
|
+
if "declared unaffected" not in narrowed_said:
|
|
26801
|
+
report(
|
|
26802
|
+
f"{label}: the narrowed branch did not report a declaration, "
|
|
26803
|
+
f"so its silence about {flag} proves nothing; "
|
|
26804
|
+
f"{narrowed_said!r}."
|
|
26805
|
+
)
|
|
26806
|
+
return 1
|
|
26807
|
+
if flag in narrowed_said:
|
|
26808
|
+
report(
|
|
26809
|
+
f"{label}: the narrowed report suggests {flag} to a reader who "
|
|
26810
|
+
f"just used it; {narrowed_said!r}."
|
|
26811
|
+
)
|
|
26812
|
+
return 1
|
|
26813
|
+
|
|
26814
|
+
report(f"{label} scenario passed.")
|
|
26815
|
+
return 0
|
|
26816
|
+
|
|
26817
|
+
|
|
26609
26818
|
# `keel context` exists to answer "what now" and answered with a noun. Issue
|
|
26610
26819
|
# #112: `Next action: change-close` followed by `keel gate change-close
|
|
26611
26820
|
# --change x` failing on the argument that stage requires — a wrong attempt
|
|
@@ -27035,6 +27244,10 @@ SCENARIOS: tuple = (
|
|
|
27035
27244
|
("an-explanation-is-printed-once", validate_explanation_is_printed_once_scenario),
|
|
27036
27245
|
("a-paused-change-is-not-the-next-action", validate_paused_change_is_not_the_next_action_scenario),
|
|
27037
27246
|
("evidence-survives-what-did-not-change", validate_evidence_survives_what_did_not_change_scenario),
|
|
27247
|
+
(
|
|
27248
|
+
"a-staleness-report-names-its-exception",
|
|
27249
|
+
validate_staleness_report_names_its_exception_scenario,
|
|
27250
|
+
),
|
|
27038
27251
|
("the-next-action-is-a-command", validate_next_action_is_a_command_scenario),
|
|
27039
27252
|
("the-overlay-names-the-invocation", validate_overlay_names_the_invocation_scenario),
|
|
27040
27253
|
(
|
package/src/core/context.js
CHANGED
|
@@ -129,7 +129,10 @@ function driftSearchSet(contract) {
|
|
|
129
129
|
`${where} Evidence, Review, and the task checkbox are not covered — `
|
|
130
130
|
+ "editing them does not move it. Reauthorize by re-running "
|
|
131
131
|
+ "`keel gate task-start` and recording the new anchor, after confirming "
|
|
132
|
-
+ "the change to the authority above was intended."
|
|
132
|
+
+ "the change to the authority above was intended. If a check's assertion "
|
|
133
|
+
+ "did not move, add `--keep-evidence <check>` to that re-record; Keel "
|
|
134
|
+
+ "records that claim and does not verify it, so state the reason in "
|
|
135
|
+
+ "Reauthorizations."
|
|
133
136
|
);
|
|
134
137
|
}
|
|
135
138
|
|
package/src/core/gates.js
CHANGED
|
@@ -147,7 +147,10 @@ function contractDriftProblem(recorded, contract) {
|
|
|
147
147
|
+ "implemented under is not the authority it is being judged against. "
|
|
148
148
|
+ "Reauthorize with `keel gate task-start --record`, which rewrites the "
|
|
149
149
|
+ "anchor in place; execution evidence produced under the previous "
|
|
150
|
-
+ "contract is stale and has to be cleared or re-verified first."
|
|
150
|
+
+ "contract is stale and has to be cleared or re-verified first. If a "
|
|
151
|
+
+ "check's assertion did not move, add `--keep-evidence <check>` to that "
|
|
152
|
+
+ "re-record; Keel records that claim and does not verify it, so state "
|
|
153
|
+
+ "the reason in Reauthorizations."
|
|
151
154
|
);
|
|
152
155
|
}
|
|
153
156
|
|
|
@@ -434,7 +437,11 @@ function taskStart(repo, options) {
|
|
|
434
437
|
+ "previous fingerprint and cannot compare a check's former text "
|
|
435
438
|
+ "to its current one. State the reason in Reauthorizations."
|
|
436
439
|
: "Execution evidence produced under the previous contract is "
|
|
437
|
-
+ "stale; clear or re-verify it before completing this task."
|
|
440
|
+
+ "stale; clear or re-verify it before completing this task. "
|
|
441
|
+
+ "If a check's assertion did not move, re-record with "
|
|
442
|
+
+ "`--keep-evidence <check>` to say so; Keel records that claim "
|
|
443
|
+
+ "and does not verify it, so state the reason in "
|
|
444
|
+
+ "Reauthorizations.")
|
|
438
445
|
);
|
|
439
446
|
}
|
|
440
447
|
}
|