@cratis/pi 7.41.0 → 7.43.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/corpus/harnesses/copilot/instructions/local-work-artifacts.instructions.md +12 -6
- package/package/corpus/harnesses/pi/extensions/cratis-hooks/index.ts +35 -2
- package/package/corpus/hooks/README.md +24 -0
- package/package/corpus/hooks/scripts/cratis-cleanup-worktrees.sh +184 -0
- package/package/corpus/hooks/settings.template.json +21 -0
- package/package/corpus/product-sync.json +3 -3
- package/package/corpus/prompts/ship-changes.prompt.md +15 -0
- package/package/corpus/rules/local-work-artifacts.md +12 -6
- package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +36 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +3 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +24 -22
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +18 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +76 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +12 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-read-surface/references/equality-filters.md +1 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +2 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +11 -5
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +1 -1
- package/package.json +1 -1
|
@@ -38,12 +38,18 @@ dumps, and similar coordination files. These are **work records, not documentati
|
|
|
38
38
|
- **A worktree is a work record too.** Create it outside the repository tree, for
|
|
39
39
|
example in a sibling `../.worktrees/` directory. A nested worktree inherits the
|
|
40
40
|
parent's `.globalconfig` alongside its own, causing .NET's `MultipleGlobalAnalyzerKeys`
|
|
41
|
-
errors or silently changing analyzer severities.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
errors or silently changing analyzer severities. **Delivered work is cleaned up by
|
|
42
|
+
`.cratis/ai/hooks/scripts/cratis-cleanup-worktrees.sh`, not by memory:** run it from the
|
|
43
|
+
main checkout when a pull request merges or you finish a task (hooks also run it after
|
|
44
|
+
`gh pr merge` and at session start where the harness supports them, and **ship-changes**
|
|
45
|
+
ends with it). It removes a worktree and its branch only on evidence the work reached the
|
|
46
|
+
default branch — pushed is not merged — and never forces; ignored files such as a nested
|
|
47
|
+
`.ai-work/`, `.env` files and local databases are deleted with it, so move anything you
|
|
48
|
+
still need out first. Do not hand-remove worktrees or `git branch -D` a delivered branch
|
|
49
|
+
when the script can; and `gh pr merge --delete-branch` from inside a worktree leaves the
|
|
50
|
+
worktree and branch behind, which is why the script exists. If the branch must outlive the
|
|
51
|
+
task unmerged, leave the worktree and say so in the handoff. Never `--force` a removal; a
|
|
52
|
+
refusal means look, not push harder.
|
|
47
53
|
- **A decision log is not a work record.** A decision — a durable choice with a
|
|
48
54
|
decider and a date — is documentation: it lives in **`decisions/`** (or the
|
|
49
55
|
repository's documented decisions folder) and is reviewed like any other
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* Claude PreToolUse (Bash) → Pi `tool_call` → cratis-guard-store-mutations.sh (exit 2 = block)
|
|
11
11
|
* Claude PreToolUse (Bash) → Pi `tool_call` → cratis-guard-pr-body.sh (exit 2 = block)
|
|
12
12
|
* Claude PostToolUse (Write|Edit) → Pi `tool_result` → cratis-pattern-scan.sh (advisory context)
|
|
13
|
+
* Claude PostToolUse (Bash) → Pi `tool_result` → cratis-cleanup-worktrees.sh --hook (removes delivered worktrees/branches)
|
|
14
|
+
* Claude SessionStart → Pi `session_start` → cratis-cleanup-worktrees.sh --hook (sweeps orphans left by any earlier session)
|
|
13
15
|
* Explicit Pi `cratis_quality_gate` tool → cratis-quality-gate.sh (exit 2 = failed)
|
|
14
16
|
*
|
|
15
17
|
* The quality gate is the one deliberate difference from Claude. It builds and tests the repository, which can
|
|
@@ -80,11 +82,11 @@ interface ScriptRun {
|
|
|
80
82
|
* writes it exists to refuse. Callers decide what to do with `failed`; this function only reports
|
|
81
83
|
* it honestly.
|
|
82
84
|
*/
|
|
83
|
-
function runScript(script: string, stdinJson: string, cwd: string, signal?: AbortSignal): Promise<ScriptRun> {
|
|
85
|
+
function runScript(script: string, stdinJson: string, cwd: string, signal?: AbortSignal, args: string[] = []): Promise<ScriptRun> {
|
|
84
86
|
return new Promise<ScriptRun>((resolve) => {
|
|
85
87
|
let proc: ReturnType<typeof spawn>;
|
|
86
88
|
try {
|
|
87
|
-
proc = spawn("bash", [script], { cwd, stdio: ["pipe", "pipe", "pipe"] });
|
|
89
|
+
proc = spawn("bash", [script, ...args], { cwd, stdio: ["pipe", "pipe", "pipe"] });
|
|
88
90
|
} catch (error) {
|
|
89
91
|
resolve({ code: 127, stdout: "", stderr: String(error), failed: true });
|
|
90
92
|
return;
|
|
@@ -187,6 +189,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
187
189
|
const guardPrBody = path.join(scriptsDir, "cratis-guard-pr-body.sh");
|
|
188
190
|
const patternScan = path.join(scriptsDir, "cratis-pattern-scan.sh");
|
|
189
191
|
const qualityGate = path.join(scriptsDir, "cratis-quality-gate.sh");
|
|
192
|
+
const cleanupWorktrees = path.join(scriptsDir, "cratis-cleanup-worktrees.sh");
|
|
190
193
|
|
|
191
194
|
// The explicit gate owns its subprocesses; shutdown also cancels a still-running tool.
|
|
192
195
|
const activeGateRuns = new Map<AbortController, Promise<void>>();
|
|
@@ -230,8 +233,38 @@ export default function (pi: ExtensionAPI) {
|
|
|
230
233
|
return runBlockingGuard(guardWrites, "cratis-guard-writes", "write", payload, ctx, "write guards");
|
|
231
234
|
});
|
|
232
235
|
|
|
236
|
+
// ── Cleanup of delivered worktrees and branches ──
|
|
237
|
+
// The script decides on evidence that the work reached the default branch and only then removes anything; this
|
|
238
|
+
// bridge just fires it at the same moments Claude does: after a delivering command, and when a session starts.
|
|
239
|
+
// A failure here must never fail the tool call that already succeeded, so it is reported, not thrown.
|
|
240
|
+
async function sweepDelivered(hookEvent: "PostToolUse" | "SessionStart", command: string | undefined, cwd: string, signal?: AbortSignal): Promise<string> {
|
|
241
|
+
if (!isInstalled(cleanupWorktrees)) return "";
|
|
242
|
+
const payload = JSON.stringify({ hook_event_name: hookEvent, cwd, tool_input: command ? { command } : undefined });
|
|
243
|
+
const run = await runScript(cleanupWorktrees, payload, cwd, signal, ["--hook"]);
|
|
244
|
+
if (run.failed) return "cratis-cleanup-worktrees is installed but could not be run, so delivered worktrees were not cleaned up.";
|
|
245
|
+
try {
|
|
246
|
+
return JSON.parse(run.stdout)?.hookSpecificOutput?.additionalContext?.trim() ?? run.stderr.trim();
|
|
247
|
+
} catch {
|
|
248
|
+
return run.stderr.trim();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
252
|
+
const message = await sweepDelivered("SessionStart", undefined, ctx.cwd);
|
|
253
|
+
if (message) pi.sendMessage({ customType: "cratis-cleanup-worktrees", content: message, display: true });
|
|
254
|
+
});
|
|
255
|
+
async function sweepAfterBash(event: any, ctx: ExtensionContext) {
|
|
256
|
+
if (event.isError) return;
|
|
257
|
+
const command = event.input?.command;
|
|
258
|
+
if (typeof command !== "string") return;
|
|
259
|
+
const message = await sweepDelivered("PostToolUse", command, ctx.cwd, ctx.signal);
|
|
260
|
+
if (!message) return;
|
|
261
|
+
const existing = Array.isArray(event.content) ? event.content : [];
|
|
262
|
+
return { content: [...existing, { type: "text", text: `\n\n[cratis-hooks]\n${message}` }] };
|
|
263
|
+
}
|
|
264
|
+
|
|
233
265
|
// ── PostToolUse → deterministic pattern scan (advisory; injects reminders the model sees) ──
|
|
234
266
|
pi.on("tool_result", async (event, ctx) => {
|
|
267
|
+
if (event.toolName === "bash") return sweepAfterBash(event, ctx);
|
|
235
268
|
if (event.toolName !== "write" && event.toolName !== "edit") return;
|
|
236
269
|
if (event.isError) return;
|
|
237
270
|
const { filePath } = writeTarget(event.toolName, (event as any).input);
|
|
@@ -12,6 +12,7 @@ Three layers:
|
|
|
12
12
|
| Hard block | `PreToolUse` on a write | `scripts/cratis-guard-writes.sh` | zero | exits **2** — the write does not happen |
|
|
13
13
|
| Hard block | `PreToolUse` on `Bash` | `scripts/cratis-guard-store-mutations.sh` | zero; parses only commands that mention `cratis` | exits **2** — the store-changing `cratis chronicle` command does not run |
|
|
14
14
|
| Hard block | `PreToolUse` on `Bash` | `scripts/cratis-guard-pr-body.sh` | fetches shared rules only for `gh pr create/edit` | exits **2** for inline bodies, invalid notes or conflicting release labels; warns and allows when offline with no cache |
|
|
15
|
+
| Cleanup of delivered work | `PostToolUse` on `Bash` (`gh pr merge`, `git pull/merge/worktree`) and `SessionStart` (Pi: `tool_result` and `session_start`) | `scripts/cratis-cleanup-worktrees.sh --hook` | zero when the command is unrelated | never blocks; removes delivered worktrees and branches, reports what it kept |
|
|
15
16
|
| Quality gate (Claude) | `Stop` | `scripts/cratis-quality-gate.sh` | one build/test run, only when relevant files changed | exits **2** — the turn does not end |
|
|
16
17
|
| Quality gate (Pi) | explicit `cratis_quality_gate` tool | same script | only at a requested verification checkpoint | error on failure; no turn-end hook |
|
|
17
18
|
|
|
@@ -60,6 +61,29 @@ conversion and Git's assume-unchanged or skip-worktree settings can hide raw dis
|
|
|
60
61
|
use those settings, independently verify raw file contents or remove the hiding settings before
|
|
61
62
|
relying on this check.
|
|
62
63
|
|
|
64
|
+
## Cleanup of delivered work
|
|
65
|
+
|
|
66
|
+
`scripts/cratis-cleanup-worktrees.sh` is the one place that removes linked worktrees and local
|
|
67
|
+
branches after their work shipped; worktrees pile up otherwise (`gh pr merge --delete-branch`
|
|
68
|
+
cannot delete a branch that a worktree still has checked out, so the pair is left behind) and eat disk.
|
|
69
|
+
It removes only on **evidence of delivery**, never on a guess: the tip is merged into `origin/<default>`
|
|
70
|
+
and was integrated rather than merely sitting on the default branch's first-parent history (where a
|
|
71
|
+
brand-new empty branch sits), or it is merged and its upstream is gone, or GitHub reports a merged pull
|
|
72
|
+
request whose head is exactly that tip. It never forces: a dirty, locked or current worktree is kept, as
|
|
73
|
+
is anything undelivered, and every kept item is reported with its reason. Ignored files (`node_modules`,
|
|
74
|
+
build output, `.ai-work/`) go with a delivered worktree; they are the disk being reclaimed.
|
|
75
|
+
|
|
76
|
+
- **When it runs.** After a Bash command that delivers or integrates work, and at the start of every
|
|
77
|
+
session, so orphans left by any earlier session, crash or harness are collected too.
|
|
78
|
+
Claude Code and Pi are wired (`settings.template.json`, the `cratis-hooks` Pi extension).
|
|
79
|
+
Harnesses with no hook wiring (Copilot, Cursor, OpenCode) rely on the **ship-changes** prompt, whose
|
|
80
|
+
final step runs the same script, and on running it by hand.
|
|
81
|
+
- **By hand.** `bash .cratis/ai/hooks/scripts/cratis-cleanup-worktrees.sh [--dry-run]` from any worktree;
|
|
82
|
+
run from the main checkout to also collect the worktree you are standing in.
|
|
83
|
+
- **Self-test.** `--self-test` plants delivered, dirty, unmerged and brand-new cases and fails if any is
|
|
84
|
+
handled wrongly.
|
|
85
|
+
- **Opt out.** `CRATIS_HOOKS_SKIP_CLEANUP=1`.
|
|
86
|
+
|
|
63
87
|
## What is enforced
|
|
64
88
|
|
|
65
89
|
Rule numbers refer to the numbered list in [`../rules/general.md`](../rules/general.md).
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Copyright (c) Cratis. All rights reserved.
|
|
3
|
+
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
4
|
+
#
|
|
5
|
+
# Deterministic cleanup of delivered work: linked worktrees and local branches whose work has
|
|
6
|
+
# reached the default branch. One script, every harness: Claude Code and Pi run it from hooks, and
|
|
7
|
+
# the ship-changes prompt runs it as a mandatory last step for harnesses without hooks.
|
|
8
|
+
#
|
|
9
|
+
# A worktree or branch is removed only on EVIDENCE that its work was delivered, never on a guess:
|
|
10
|
+
# 1. its tip is merged into origin/<default> AND was integrated (it is not simply sitting on the
|
|
11
|
+
# default branch's first-parent history, which is where a brand-new, empty branch sits), or
|
|
12
|
+
# 2. its tip is merged into origin/<default> and its upstream is gone (the PR branch was deleted), or
|
|
13
|
+
# 3. GitHub reports a merged pull request whose head commit is exactly this tip.
|
|
14
|
+
# Anything else is KEPT and reported with the reason. Nothing is ever forced: a dirty, locked or
|
|
15
|
+
# current worktree is kept, and `git worktree remove` is never given --force.
|
|
16
|
+
#
|
|
17
|
+
# Usage:
|
|
18
|
+
# cratis-cleanup-worktrees.sh [--dry-run] [--quiet] [--no-fetch] run in the repository (any worktree)
|
|
19
|
+
# cratis-cleanup-worktrees.sh --hook Claude hook mode: reads the hook JSON
|
|
20
|
+
# on stdin, acts only when relevant
|
|
21
|
+
# cratis-cleanup-worktrees.sh --self-test plants cases and fails if any is wrong
|
|
22
|
+
#
|
|
23
|
+
# Exit: 0 ran (kept items are not failures), 2 could not run. Opt out: CRATIS_HOOKS_SKIP_CLEANUP=1.
|
|
24
|
+
# Portable: bash 3.2, BSD + GNU userland.
|
|
25
|
+
# shellcheck disable=SC2016 # the self-test checks are single-quoted on purpose: they are eval-ed later
|
|
26
|
+
set -uo pipefail
|
|
27
|
+
|
|
28
|
+
DRY=0; QUIET=0; FETCH=1; HOOK=0; SELFTEST=0
|
|
29
|
+
for a in "$@"; do
|
|
30
|
+
case "$a" in
|
|
31
|
+
--dry-run) DRY=1 ;; --quiet) QUIET=1 ;; --no-fetch) FETCH=0 ;;
|
|
32
|
+
--hook) HOOK=1; QUIET=1 ;; --self-test) SELFTEST=1 ;;
|
|
33
|
+
*) echo "cratis-cleanup-worktrees: unknown argument '$a'" >&2; exit 2 ;;
|
|
34
|
+
esac
|
|
35
|
+
done
|
|
36
|
+
|
|
37
|
+
# ── Hook mode: decide whether this event is worth a sweep ─────────────────────
|
|
38
|
+
EVENT="PostToolUse"
|
|
39
|
+
if [ "$HOOK" = 1 ]; then
|
|
40
|
+
payload=''; IFS= read -r -d '' payload || true
|
|
41
|
+
[ "${CRATIS_HOOKS_SKIP_CLEANUP:-}" = 1 ] && exit 0
|
|
42
|
+
case "$payload" in *'"SessionStart"'*) EVENT="SessionStart" ;; esac
|
|
43
|
+
if [ "$EVENT" = "PostToolUse" ]; then
|
|
44
|
+
flat=${payload//\\n/ }; flat=${flat//\\\"/\"}
|
|
45
|
+
# Only commands that deliver or integrate work; everything else costs nothing.
|
|
46
|
+
if [[ ! "$flat" =~ (gh[[:space:]]+pr[[:space:]]+merge|git[[:space:]]+(-C[[:space:]]+[^[:space:]]+[[:space:]]+)?(pull|merge|worktree[[:space:]]+(add|remove|prune))|git[[:space:]]+push[[:space:]].*--delete) ]]; then
|
|
47
|
+
exit 0
|
|
48
|
+
fi
|
|
49
|
+
fi
|
|
50
|
+
cwd=""
|
|
51
|
+
command -v jq >/dev/null 2>&1 && cwd=$(printf '%s' "$payload" | jq -r '.cwd // empty' 2>/dev/null)
|
|
52
|
+
if [ -n "$cwd" ] && [ -d "$cwd" ]; then cd "$cwd" || exit 0; fi
|
|
53
|
+
fi
|
|
54
|
+
[ "${CRATIS_HOOKS_SKIP_CLEANUP:-}" = 1 ] && [ "$SELFTEST" = 0 ] && exit 0
|
|
55
|
+
|
|
56
|
+
# ── Self-test ─────────────────────────────────────────────────────────────────
|
|
57
|
+
if [ "$SELFTEST" = 1 ]; then
|
|
58
|
+
self=$(cd "$(dirname "$0")" && pwd)/$(basename "$0")
|
|
59
|
+
t=$(mktemp -d "${TMPDIR:-/tmp}/cleanup-selftest.XXXXXX"); trap 'rm -rf "$t"' EXIT
|
|
60
|
+
export GIT_AUTHOR_NAME=t GIT_AUTHOR_EMAIL=t@t GIT_COMMITTER_NAME=t GIT_COMMITTER_EMAIL=t@t CRATIS_CLEANUP_NO_GH=1
|
|
61
|
+
git init -q --bare -b main "$t/origin.git"
|
|
62
|
+
git clone -q "$t/origin.git" "$t/repo" 2>/dev/null; cd "$t/repo" || exit 2
|
|
63
|
+
git checkout -q -b main 2>/dev/null; echo a > a; git add a; git commit -qm base; git push -q origin main
|
|
64
|
+
mk() { git worktree add -q -b "$1" "$t/wt-$1" main; }
|
|
65
|
+
mk delivered; (cd "$t/wt-delivered" && echo d > d && git add d && git commit -qm d)
|
|
66
|
+
mk dirty; (cd "$t/wt-dirty" && echo x > x && git add x && git commit -qm x)
|
|
67
|
+
mk unmerged; (cd "$t/wt-unmerged" && echo u > u && git add u && git commit -qm u)
|
|
68
|
+
mk fresh # brand new, no commits: must survive
|
|
69
|
+
git branch loose-delivered main; (git checkout -q loose-delivered && echo l > l && git add l && git commit -qm l && git checkout -q main)
|
|
70
|
+
git merge -q --no-ff delivered -m "merge delivered" && git merge -q --no-ff dirty -m "merge dirty" && git merge -q --no-ff loose-delivered -m "merge loose"
|
|
71
|
+
git push -q origin main
|
|
72
|
+
echo junk > "$t/wt-dirty/untracked" # makes the merged worktree dirty
|
|
73
|
+
out=$("$self" --no-fetch 2>&1) || { echo "FAIL: exit $?"; echo "$out"; exit 1; }
|
|
74
|
+
fail=0; chk() { if ! eval "$2"; then echo "FAIL: $1"; fail=1; fi; }
|
|
75
|
+
chk "delivered worktree removed" '[ ! -d "$t/wt-delivered" ]'
|
|
76
|
+
chk "delivered branch removed" '! git rev-parse -q --verify refs/heads/delivered >/dev/null'
|
|
77
|
+
chk "loose merged branch removed" '! git rev-parse -q --verify refs/heads/loose-delivered >/dev/null'
|
|
78
|
+
chk "dirty worktree kept" '[ -d "$t/wt-dirty" ]'
|
|
79
|
+
chk "unmerged worktree kept" '[ -d "$t/wt-unmerged" ]'
|
|
80
|
+
chk "unmerged branch kept" 'git rev-parse -q --verify refs/heads/unmerged >/dev/null'
|
|
81
|
+
chk "fresh worktree kept" '[ -d "$t/wt-fresh" ]'
|
|
82
|
+
chk "fresh branch kept" 'git rev-parse -q --verify refs/heads/fresh >/dev/null'
|
|
83
|
+
chk "main kept" 'git rev-parse -q --verify refs/heads/main >/dev/null'
|
|
84
|
+
chk "report names the removal" 'printf "%s" "$out" | grep -q "removed worktree"'
|
|
85
|
+
[ "$fail" = 0 ] && echo "cratis-cleanup-worktrees self-test: 10 checks passed" && exit 0
|
|
86
|
+
echo "$out"; exit 1
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
# ── Locate the repository ─────────────────────────────────────────────────────
|
|
90
|
+
git rev-parse --git-dir >/dev/null 2>&1 || { [ "$QUIET" = 1 ] || echo "cratis-cleanup-worktrees: not in a git repository" >&2; exit "$([ "$HOOK" = 1 ] && echo 0 || echo 2)"; }
|
|
91
|
+
here=$(pwd -P)
|
|
92
|
+
main_wt=$(git worktree list --porcelain | awk 'NR==1 && $1=="worktree"{sub(/^worktree /,""); print; exit}')
|
|
93
|
+
if [ ! -d "$main_wt" ]; then echo "cratis-cleanup-worktrees: cannot find the main worktree" >&2; exit 2; fi
|
|
94
|
+
cd "$main_wt" || exit 2
|
|
95
|
+
|
|
96
|
+
if [ "$FETCH" = 1 ]; then git fetch --prune --quiet origin >/dev/null 2>&1 || LOG_NOFETCH=1; fi
|
|
97
|
+
default=$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null || true)
|
|
98
|
+
[ -n "$default" ] || { for c in origin/main origin/master; do git rev-parse -q --verify "refs/remotes/$c" >/dev/null && default=$c && break; done; }
|
|
99
|
+
[ -n "$default" ] || { [ "$QUIET" = 1 ] || echo "cratis-cleanup-worktrees: no origin default branch; nothing to compare against" >&2; exit "$([ "$HOOK" = 1 ] && echo 0 || echo 2)"; }
|
|
100
|
+
default_local=${default#origin/}
|
|
101
|
+
|
|
102
|
+
firstparent=$(mktemp "${TMPDIR:-/tmp}/cleanup-fp.XXXXXX"); trap 'rm -f "$firstparent"' EXIT
|
|
103
|
+
git rev-list --first-parent "$default" > "$firstparent" 2>/dev/null
|
|
104
|
+
|
|
105
|
+
REMOVED=(); KEPT=(); FREED_KB=0
|
|
106
|
+
note_removed() { REMOVED+=("$1"); }
|
|
107
|
+
note_kept() { KEPT+=("$1"); }
|
|
108
|
+
|
|
109
|
+
# delivered <sha> <branch|""> <upstream-track> → prints the evidence, returns 0 when delivered
|
|
110
|
+
delivered() {
|
|
111
|
+
local sha="$1" br="$2" track="$3"
|
|
112
|
+
if git merge-base --is-ancestor "$sha" "$default" 2>/dev/null; then
|
|
113
|
+
if ! grep -qx "$sha" "$firstparent"; then echo "merged into $default"; return 0; fi
|
|
114
|
+
if [ "$track" = "[gone]" ]; then echo "merged into $default, upstream gone"; return 0; fi
|
|
115
|
+
fi
|
|
116
|
+
if [ -n "$br" ] && [ "${CRATIS_CLEANUP_NO_GH:-}" != 1 ] && command -v gh >/dev/null 2>&1; then
|
|
117
|
+
if gh pr list --head "$br" --state merged --json headRefOid -q '.[].headRefOid' 2>/dev/null | grep -qx "$sha"; then
|
|
118
|
+
echo "pull request merged at this commit"; return 0
|
|
119
|
+
fi
|
|
120
|
+
fi
|
|
121
|
+
return 1
|
|
122
|
+
}
|
|
123
|
+
track_of() { git for-each-ref --format='%(upstream:track)' "refs/heads/$1" 2>/dev/null; }
|
|
124
|
+
|
|
125
|
+
# ── Worktrees ─────────────────────────────────────────────────────────────────
|
|
126
|
+
git worktree prune >/dev/null 2>&1
|
|
127
|
+
wt=""; sha=""; br=""; locked=0; first=1
|
|
128
|
+
process_worktree() {
|
|
129
|
+
[ -n "$wt" ] || return 0
|
|
130
|
+
if [ "$first" = 1 ]; then first=0; return 0; fi # the main worktree is never removed
|
|
131
|
+
local name="${br:-detached}" ev
|
|
132
|
+
if [ "$locked" = 1 ]; then note_kept "worktree $wt ($name): locked"; return 0; fi
|
|
133
|
+
case "$here/" in "$wt"/*) note_kept "worktree $wt ($name): it is the current directory - run the sweep from the main checkout"; return 0 ;; esac
|
|
134
|
+
if ! ev=$(delivered "$sha" "$br" "$([ -n "$br" ] && track_of "$br")"); then
|
|
135
|
+
note_kept "worktree $wt ($name): work not delivered to $default"; return 0
|
|
136
|
+
fi
|
|
137
|
+
if [ -n "$(git -C "$wt" status --porcelain 2>/dev/null)" ]; then note_kept "worktree $wt ($name): delivered but has uncommitted changes"; return 0; fi
|
|
138
|
+
local kb; kb=$(du -sk "$wt" 2>/dev/null | awk '{print $1}')
|
|
139
|
+
if [ "$DRY" = 1 ]; then note_removed "worktree $wt ($name): would remove, $ev"; return 0; fi
|
|
140
|
+
if git worktree remove "$wt" >/dev/null 2>&1; then
|
|
141
|
+
FREED_KB=$((FREED_KB + ${kb:-0})); note_removed "worktree $wt ($name): $ev"
|
|
142
|
+
else note_kept "worktree $wt ($name): git refused to remove it"; fi
|
|
143
|
+
}
|
|
144
|
+
while IFS= read -r line; do
|
|
145
|
+
case "$line" in
|
|
146
|
+
"worktree "*) process_worktree; wt=${line#worktree }; sha=""; br=""; locked=0 ;;
|
|
147
|
+
"HEAD "*) sha=${line#HEAD } ;;
|
|
148
|
+
"branch "*) br=${line#branch refs/heads/} ;;
|
|
149
|
+
"locked"*) locked=1 ;;
|
|
150
|
+
esac
|
|
151
|
+
done < <(git worktree list --porcelain; echo)
|
|
152
|
+
process_worktree
|
|
153
|
+
|
|
154
|
+
# ── Local branches ────────────────────────────────────────────────────────────
|
|
155
|
+
in_use=$(git worktree list --porcelain | sed -n 's#^branch refs/heads/##p')
|
|
156
|
+
while IFS='|' read -r b bsha; do
|
|
157
|
+
if [ -z "$b" ] || [ "$b" = "$default_local" ]; then continue; fi
|
|
158
|
+
printf '%s\n' "$in_use" | grep -qx "$b" && continue
|
|
159
|
+
if ev=$(delivered "$bsha" "$b" "$(track_of "$b")"); then
|
|
160
|
+
if [ "$DRY" = 1 ]; then note_removed "branch $b: would delete, $ev"
|
|
161
|
+
elif git branch -D "$b" >/dev/null 2>&1; then note_removed "branch $b: $ev"
|
|
162
|
+
else note_kept "branch $b: git refused to delete it"; fi
|
|
163
|
+
else
|
|
164
|
+
note_kept "branch $b: work not delivered to $default"
|
|
165
|
+
fi
|
|
166
|
+
done < <(git for-each-ref --format='%(refname:short)|%(objectname)' refs/heads)
|
|
167
|
+
|
|
168
|
+
# ── Report ────────────────────────────────────────────────────────────────────
|
|
169
|
+
summary="cratis-cleanup-worktrees: ${#REMOVED[@]} removed, ${#KEPT[@]} kept"
|
|
170
|
+
[ "$FREED_KB" -gt 0 ] && summary="$summary, $((FREED_KB / 1024)) MB freed"
|
|
171
|
+
[ "${LOG_NOFETCH:-0}" = 1 ] && summary="$summary (fetch failed: compared against the last fetched $default)"
|
|
172
|
+
if [ "$HOOK" = 1 ]; then
|
|
173
|
+
[ "${#REMOVED[@]}" -gt 0 ] || { [ "$EVENT" = "SessionStart" ] && [ "${#KEPT[@]}" -gt 0 ]; } || exit 0
|
|
174
|
+
msg="$summary."
|
|
175
|
+
[ "${#KEPT[@]}" -gt 0 ] && msg="$msg Kept (not delivered or not safe to remove): $(printf '%s; ' "${KEPT[@]}")"
|
|
176
|
+
command -v jq >/dev/null 2>&1 && jq -nc --arg m "$msg" --arg e "$EVENT" '{systemMessage:$m,hookSpecificOutput:{hookEventName:$e,additionalContext:$m}}' || printf '%s\n' "$msg" >&2
|
|
177
|
+
exit 0
|
|
178
|
+
fi
|
|
179
|
+
if [ "$QUIET" = 0 ]; then
|
|
180
|
+
echo "$summary"
|
|
181
|
+
for r in "${REMOVED[@]+"${REMOVED[@]}"}"; do echo " removed $r"; done
|
|
182
|
+
for k in "${KEPT[@]+"${KEPT[@]}"}"; do echo " kept $k"; done
|
|
183
|
+
fi
|
|
184
|
+
exit 0
|
|
@@ -25,7 +25,28 @@
|
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
],
|
|
28
|
+
"SessionStart": [
|
|
29
|
+
{
|
|
30
|
+
"hooks": [
|
|
31
|
+
{
|
|
32
|
+
"type": "command",
|
|
33
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR\"/.cratis/ai/hooks/scripts/cratis-cleanup-worktrees.sh --hook",
|
|
34
|
+
"timeout": 90
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
28
39
|
"PostToolUse": [
|
|
40
|
+
{
|
|
41
|
+
"matcher": "Bash",
|
|
42
|
+
"hooks": [
|
|
43
|
+
{
|
|
44
|
+
"type": "command",
|
|
45
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR\"/.cratis/ai/hooks/scripts/cratis-cleanup-worktrees.sh --hook",
|
|
46
|
+
"timeout": 90
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
29
50
|
{
|
|
30
51
|
"matcher": "Write|Edit|MultiEdit|NotebookEdit",
|
|
31
52
|
"hooks": [
|
|
@@ -166,9 +166,9 @@
|
|
|
166
166
|
}
|
|
167
167
|
],
|
|
168
168
|
"synced": {
|
|
169
|
-
"version": "4.
|
|
169
|
+
"version": "4.149.0",
|
|
170
170
|
"date": "2026-10-13",
|
|
171
|
-
"by": "Cratis/AI#
|
|
171
|
+
"by": "Cratis/AI#645"
|
|
172
172
|
},
|
|
173
173
|
"covers": {
|
|
174
174
|
"skills": [
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
],
|
|
197
197
|
"rules": []
|
|
198
198
|
},
|
|
199
|
-
"notes": "Standalone 4.
|
|
199
|
+
"notes": "Standalone 4.149.0 tool and byte-identical published/Golden contract pinned for Cratis/AI#645. Adds the concept generation MCP summary, typed strategy editing guidance and PLAY0683/PLAY0684 entropy/uniqueness repairs; derived regex, matches/checksum repair and rule-proof status remain unshipped. Retains ESM v15 strategies, strict fixtures, whole-source freshness and 4.148.0 response-name resolution. Historical evidence stays qualified. CLI 3.57.0 / MCP 4.147.1 lacks the new summary and repairs; this pin does not upgrade CLI or Scene runtime."
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
"id": "scene",
|
|
@@ -52,3 +52,18 @@ The description is published verbatim as the release notes, so it follows the co
|
|
|
52
52
|
deploy order) right after creating the PR with `gh pr comment <n> --body-file .ai-work/pr-notes.md`.
|
|
53
53
|
Never put them in the description, even for `no-release`.
|
|
54
54
|
- After pushing, if `verify-release-notes` fails, fix it by editing the description; it re-runs on edit.
|
|
55
|
+
|
|
56
|
+
## Cleanup — the last step, never skipped
|
|
57
|
+
|
|
58
|
+
Shipping is not finished until the delivered work is cleaned up. Worktrees and branches left behind
|
|
59
|
+
cost real disk and accumulate across sessions. After the merge succeeds:
|
|
60
|
+
|
|
61
|
+
1. Leave the worktree you worked in: `cd` to the main checkout (`git worktree list` shows it first).
|
|
62
|
+
2. Run `bash .cratis/ai/hooks/scripts/cratis-cleanup-worktrees.sh` and report its summary line.
|
|
63
|
+
It fetches, checks out nothing, and removes only worktrees and local branches whose work is
|
|
64
|
+
verifiably on the default branch (this one included); it never forces and reports what it kept and why.
|
|
65
|
+
3. `git switch main && git pull --ff-only` in the main checkout so it matches the merged result.
|
|
66
|
+
|
|
67
|
+
Claude Code and Pi also run the script from a hook after `gh pr merge` and at session start; running it
|
|
68
|
+
here as well is deliberate, because Copilot, Cursor and OpenCode have no hook and this step is their only
|
|
69
|
+
trigger. If the script reports the shipped worktree as kept, say why in the final message.
|
|
@@ -37,12 +37,18 @@ dumps, and similar coordination files. These are **work records, not documentati
|
|
|
37
37
|
- **A worktree is a work record too.** Create it outside the repository tree, for
|
|
38
38
|
example in a sibling `../.worktrees/` directory. A nested worktree inherits the
|
|
39
39
|
parent's `.globalconfig` alongside its own, causing .NET's `MultipleGlobalAnalyzerKeys`
|
|
40
|
-
errors or silently changing analyzer severities.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
errors or silently changing analyzer severities. **Delivered work is cleaned up by
|
|
41
|
+
`.cratis/ai/hooks/scripts/cratis-cleanup-worktrees.sh`, not by memory:** run it from the
|
|
42
|
+
main checkout when a pull request merges or you finish a task (hooks also run it after
|
|
43
|
+
`gh pr merge` and at session start where the harness supports them, and **ship-changes**
|
|
44
|
+
ends with it). It removes a worktree and its branch only on evidence the work reached the
|
|
45
|
+
default branch — pushed is not merged — and never forces; ignored files such as a nested
|
|
46
|
+
`.ai-work/`, `.env` files and local databases are deleted with it, so move anything you
|
|
47
|
+
still need out first. Do not hand-remove worktrees or `git branch -D` a delivered branch
|
|
48
|
+
when the script can; and `gh pr merge --delete-branch` from inside a worktree leaves the
|
|
49
|
+
worktree and branch behind, which is why the script exists. If the branch must outlive the
|
|
50
|
+
task unmerged, leave the worktree and say so in the handoff. Never `--force` a removal; a
|
|
51
|
+
refusal means look, not push harder.
|
|
46
52
|
- **A decision log is not a work record.** A decision — a durable choice with a
|
|
47
53
|
decider and a date — is documentation: it lives in **`decisions/`** (or the
|
|
48
54
|
repository's documented decisions folder) and is reviewed like any other
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
5
|
- The concept declares how; the property declares that
|
|
6
|
+
- Inspect and edit generation through MCP
|
|
6
7
|
- Version and freshness
|
|
7
8
|
- Responses and pre-generation boundaries
|
|
8
9
|
- What CLI 3.57.0 / Stage 4.89.1 realizes
|
|
9
10
|
|
|
10
11
|
`generated` properties and `returns` bind/reference-execute since 4.68.0 (ESM v7).
|
|
11
12
|
Concept generation strategies and whole-source freshness shipped in Screenplay
|
|
12
|
-
4.147.0 (ESM v15); standalone pin **4.
|
|
13
|
+
4.147.0 (ESM v15); standalone pin **4.149.0** includes them. CLI **3.57.0** bundles
|
|
13
14
|
Screenplay **4.147.1** / Stage **4.89.1**, rendering the supported strategies,
|
|
14
15
|
scalar/named responses, fixtures and `then returns`. Binding is not rendering.
|
|
15
16
|
Historical CLI 3.41.0 STAGE-ESM-028/029 probes do not describe this bundle.
|
|
@@ -71,6 +72,40 @@ Stage render generated unique-constraint mappings.
|
|
|
71
72
|
and compliance markers, including generated secrets, remain refused. Do not
|
|
72
73
|
remove classification or pretend a random String is a credential contract.
|
|
73
74
|
|
|
75
|
+
## Inspect and edit generation through MCP
|
|
76
|
+
|
|
77
|
+
Screenplay **4.149.0** adds a concept `generation` summary and entropy repairs.
|
|
78
|
+
Use `screenplay_declaration_details` with `kind: "Concept"`, `view: "summary"`:
|
|
79
|
+
only authored `generate` gets a block, with strategy, set modifiers,
|
|
80
|
+
preview-only arguments, `entropyBits`, `entropyUnknownReason` when null,
|
|
81
|
+
`valuesAtOnePercentCollision` and `executable.status`. Status is `admitted` only
|
|
82
|
+
after whole-model binding, `refused` for errors at this concept/generation, or
|
|
83
|
+
`notAssessed` with a reason for unrelated binding failures. Empty local codes do
|
|
84
|
+
not prove admission; large collision counts may exceed client numeric range.
|
|
85
|
+
|
|
86
|
+
Set/change/remove `generate` through `screenplay_propose_ast` (replace the concept's
|
|
87
|
+
`GenerationSyntax`, omit/null `generation` to remove) or reviewed
|
|
88
|
+
`screenplay_propose_source`; do not hand-edit the text. Inspect executable
|
|
89
|
+
diagnostics independently of authoring acceptance: sequence PLAY0682;
|
|
90
|
+
pattern/random/rule and generated-concept rules PLAY0268. Review, run candidate
|
|
91
|
+
specifications where executable, then apply with revisions.
|
|
92
|
+
|
|
93
|
+
`screenplay_repair_capabilities` advertises PLAY0683/0684; workspace repairs supply
|
|
94
|
+
the selected `diagnosticCode` and `subject` for `screenplay_propose_repair`.
|
|
95
|
+
The concept subject raises NanoID to the smallest size reaching 64 random bits
|
|
96
|
+
for its alphabet, or bytes count to 8 (possibly in another document). PLAY0683
|
|
97
|
+
also offers uniqueness for a non-identifier command-property subject only when
|
|
98
|
+
exactly one production maps it to exactly one event property. Both require
|
|
99
|
+
individual review and `CanonicalizeTouchedDocuments`, with no pinned evidence.
|
|
100
|
+
Length changes affect all concept uses; uniqueness changes append-time behavior.
|
|
101
|
+
Derived regex, matches/checksum repairs and rule-proof status are not shipped.
|
|
102
|
+
CLI **3.57.0** / MCP **4.147.1** lacks this summary and these repairs; it still
|
|
103
|
+
supports existing typed concept proposals. Full fields, mapping limits and tagged
|
|
104
|
+
source evidence: [MCP generation guide](../../cratis-screenplay-model-authoring/references/mcp-tools.md#concept-generation-41490).
|
|
105
|
+
Sources: Cratis/Screenplay `v4.149.0:Documentation/screenplay/generated-values.md:62-70`,
|
|
106
|
+
`Source/DotNET/Screenplay.Mcp/McpGenerationDetails.cs:13-83`,
|
|
107
|
+
`Source/DotNET/Screenplay/Workspaces/WorkspaceGenerationRepairs.cs:29-134`.
|
|
108
|
+
|
|
74
109
|
## Version and freshness
|
|
75
110
|
|
|
76
111
|
A serialized concept `generation` member selects **v15**. Implicit Uuid generation
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
6
|
{ "kind": "play-compiles" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "screenplay_declaration_details", "file": "references/generated-values-and-responses.md" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "do not hand-edit the text", "file": "references/generated-values-and-responses.md" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "CLI **3.57.0** / MCP **4.147.1** lacks this summary", "file": "references/generated-values-and-responses.md" },
|
|
7
10
|
{ "kind": "skill-contains", "value": "optional concept `compliance` as ESM v13", "file": "references/compliance.md" },
|
|
8
11
|
{ "kind": "skill-contains", "value": "PLAY0268 at binding only", "file": "references/compliance.md" },
|
|
9
12
|
{ "kind": "skill-contains", "value": "reasons stay report-only PLAY0270", "file": "references/compliance.md" },
|
|
@@ -25,7 +25,8 @@ same model root or workspace export to all checks. Workflow:
|
|
|
25
25
|
|
|
26
26
|
Screenplay v4.144.0: model notes sources/lines in `references/model-notes.md`;
|
|
27
27
|
v4.142.0 add/rename/remove planner in `references/property-links.md`;
|
|
28
|
-
compliance in command-surface `references/compliance.md`.
|
|
28
|
+
compliance in command-surface `references/compliance.md`. Generation MCP: v4.149.0,
|
|
29
|
+
[fields/repairs/sources](references/mcp-tools.md#concept-generation-41490). Other MCP evidence:
|
|
29
30
|
v4.139.0 `Documentation/screenplay/mcp/`.
|
|
30
31
|
Discover installed tools and schemas; CLI bundles can differ from the standalone
|
|
31
32
|
tool. Pins are in `cratis-screenplay-toolchain` `references/versions.md`.
|
|
@@ -73,10 +74,10 @@ The CLI entry point is:
|
|
|
73
74
|
cratis screenplay mcp <model-folder>
|
|
74
75
|
```
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
CLI 3.57.0 bundles MCP 4.147.1, lacking the generation summary/entropy repairs.
|
|
78
|
+
Discover installed capabilities. Do not ask for a second global .NET tool, Docker
|
|
79
|
+
or hand-copied managed MCP configuration. Installation/status must confirm adapter
|
|
80
|
+
support and no conflicts.
|
|
80
81
|
|
|
81
82
|
If the MCP is unavailable, report that gap. Do not claim compiler-validated AST
|
|
82
83
|
editing while falling back to regex. Existing standalone `screenplay mcp` users
|
|
@@ -91,6 +92,8 @@ can keep that entry point; use the project's supported installation channel.
|
|
|
91
92
|
Before a property change, read [property links](references/property-links.md):
|
|
92
93
|
`kind: "Property"`, `Owner.member` / `Owner.generationN.member`, direct mappings.
|
|
93
94
|
`complete: false` is incomplete evidence, never a successful empty list.
|
|
95
|
+
For `generate`, inspect Concept `summary`: entropy and admission are separate.
|
|
96
|
+
Edit through MCP proposals, not hand-edited text; [generation guide](references/mcp-tools.md#concept-generation-41490).
|
|
94
97
|
3. Read diagnostics and coverage limitations. Use `dependency-graph` for container
|
|
95
98
|
edges, declared-dependency coverage, cycles and advisory order; the board's
|
|
96
99
|
dependency-map toggle exposes this evidence visually. Unknown or ambiguous
|
|
@@ -127,8 +130,8 @@ query argument or specification goes through MCP, and an `id` pin is not enough
|
|
|
127
130
|
a rename, move or removal is the approval: do not ask again at `apply`. Without MCP, text-rename
|
|
128
131
|
with `id "<Old>"` pins and an identity note; only with `identities.json` and no MCP, return the
|
|
129
132
|
request to the owning session, saying first it is NOT done.
|
|
130
|
-
Proposals are connection-local (
|
|
131
|
-
|
|
133
|
+
Proposals are connection-local (16 cap); only the owner proposes/applies.
|
|
134
|
+
Others send an edit request ([MCP loop](references/mcp-loop.md)).
|
|
132
135
|
|
|
133
136
|
- Apply is not crash-atomic across files: it journals its inverse first. The model
|
|
134
137
|
root must be trusted and exclusively writable during effects.
|
|
@@ -156,25 +159,22 @@ and applies; others send an edit request ([MCP loop](references/mcp-loop.md)).
|
|
|
156
159
|
model. Paging and read-only candidate semantics: [MCP tool guide](references/mcp-tools.md#run-reference-specifications).
|
|
157
160
|
8. `apply` only the reviewed server-produced proposal within the user's requested
|
|
158
161
|
change. The proposal ID and before revisions are required; stale state rejects.
|
|
159
|
-
When the user
|
|
160
|
-
"apply each change"), apply once the proposal checks out instead of asking again;
|
|
162
|
+
When the user already requested apply, do it after checks without asking again;
|
|
161
163
|
otherwise show the proposal and ask once.
|
|
162
164
|
9. When the host draws views, `visualize-model` shows the board. It follows the files
|
|
163
165
|
on disk while open, so after an apply do not re-request it; just say what changed.
|
|
164
166
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
assume every fragment changed. After apply, fetch fresh handles/revisions.
|
|
167
|
+
Handles are revision-bound occurrences, not durable IDs. Modules/features can
|
|
168
|
+
span fragments; one header edit may not change all. After apply, fetch fresh handles/revisions.
|
|
168
169
|
|
|
169
|
-
|
|
170
|
-
when a call refuses or paging hits a limit; use `failureKind`, never message text.
|
|
170
|
+
On refusal, use `failureKind`, never message text ([failures/limits](references/mcp-loop.md#failures-use-failurekind-never-message-text)).
|
|
171
171
|
After revision/disk/identity drift, reopen and re-propose. For `ApplyOutcomeUnknown`
|
|
172
172
|
or EOF during `apply`, **never retry apply**: reconnect, inspect `workspace-state`
|
|
173
173
|
and ask. Never delete `.screenplay/pending.json`. Limits reject, never truncate.
|
|
174
174
|
|
|
175
|
-
Choose formatting
|
|
176
|
-
|
|
177
|
-
`PreserveTrivia`, canonical consent
|
|
175
|
+
Choose formatting and disclose dropped comments before apply:
|
|
176
|
+
[formatting/limits](references/mcp-loop.md#formatting-and-limits) covers
|
|
177
|
+
`PreserveTrivia`, canonical consent and byte preservation.
|
|
178
178
|
|
|
179
179
|
`identityMigrationIssues`: read the [MCP loop](references/mcp-loop.md).
|
|
180
180
|
|
|
@@ -199,6 +199,9 @@ from silently changing the reviewed candidate.
|
|
|
199
199
|
No automatic generation-evolution repair ships.
|
|
200
200
|
- `PLAY0479`: migrate optionality spelling with `PreserveTrivia`; document scope
|
|
201
201
|
migrates all occurrences together. Keep the `query Q => observable?` exception.
|
|
202
|
+
- PLAY0683/PLAY0684: raise entropy (concept subject) or PLAY0683 uniqueness
|
|
203
|
+
(command-property subject). Individual review, canonical formatting, no pinned
|
|
204
|
+
evidence; [limits](references/mcp-tools.md#concept-generation-41490).
|
|
202
205
|
- Compliance repairs PLAY0565/0653: [MCP tool guide](references/mcp-tools.md).
|
|
203
206
|
|
|
204
207
|
`propose-number-enum-members` pins an unnumbered enum to current positions.
|
|
@@ -240,11 +243,10 @@ the edited fragment.
|
|
|
240
243
|
|
|
241
244
|
## Preserve state and recover explicitly
|
|
242
245
|
|
|
243
|
-
|
|
244
|
-
`
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
not text-rename identity-affecting declarations in a model that has it.
|
|
246
|
+
Commit `.screenplay/identities.json` with the model. Only `apply` writes it;
|
|
247
|
+
`open-workspace` never creates it; text-only models have none. Never delete or
|
|
248
|
+
overwrite conflicting identity state, silently mint IDs on restart, or text-rename
|
|
249
|
+
identity-affecting declarations in a model that has it.
|
|
248
250
|
|
|
249
251
|
Default root discovery preserves ancestor identity state and journals. Inspect
|
|
250
252
|
`rootBindingConflict` in `open-workspace`/`workspace-state` when several state roots
|
package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md
CHANGED
|
@@ -250,7 +250,7 @@ the standalone 4.66.0 tool for the rows marked "probed"; Cratis CLI 3.28.2 and 3
|
|
|
250
250
|
Screenplay 4.66.0 (before 3.28.2, Screenplay 4.60.1, differ where stated).
|
|
251
251
|
|
|
252
252
|
Read-model identity below is corrected to 4.135.0; equality query filters are
|
|
253
|
-
updated to standalone 4.
|
|
253
|
+
updated to standalone 4.149.0 (admitted in 4.143.0, ESM v14):
|
|
254
254
|
explicit trailing `key` wins; otherwise single-instance queries in the owning slice
|
|
255
255
|
must agree on `by`. Only with no single-instance identifier and an admitted list
|
|
256
256
|
query does conventional `*Id` inference run. Queryless views need explicit `key`.
|
|
@@ -112,6 +112,11 @@ the server sends `roots/list` and serves `tools/list` after the reply).
|
|
|
112
112
|
`Owner.generationN.member`. Follow direct mapping counterparts one query at a
|
|
113
113
|
time; inspect incomplete/ambiguous evidence and `reasons`. `complete: false`
|
|
114
114
|
is not an empty successful result. Shapes/roles: [property links](property-links.md).
|
|
115
|
+
On Screenplay 4.149.0, inspect concept `generate` with `declaration-details`
|
|
116
|
+
`kind: "Concept"`, `view: "summary"`: `generation.executable.status` distinguishes
|
|
117
|
+
`admitted`, `refused`, `notAssessed`; empty local error codes do not prove binding.
|
|
118
|
+
The CLI 3.57.0 / MCP 4.147.1 bundle lacks this summary and entropy repairs.
|
|
119
|
+
Fields and tagged evidence: [concept generation](mcp-tools.md#concept-generation-41490).
|
|
115
120
|
3. `open-workspace` and keep `revision` and `catalogRevision`. Opening writes
|
|
116
121
|
nothing. With `identityPersistence: "root-local-on-apply"` the identities file
|
|
117
122
|
is written only by `apply`.
|
|
@@ -196,12 +201,24 @@ the server sends `roots/list` and serves `tools/list` after the reply).
|
|
|
196
201
|
| --- | --- | --- |
|
|
197
202
|
| Address-preserving | descriptions; bodies of rules and expressions; mappings between members that already exist; any edit that adds, removes or renames no addressed element. Also every edit in a model with no `.screenplay/identities.json` except persisted names | bounded text edit of the `.play` file, then compile the folder; or `propose-ast` |
|
|
198
203
|
| Catalog-changing (identity file present) | add, remove or rename a declaration (slice, command, event, read model, projection, ...), a property of a command, event, read model, composite type or trigger, a query, a query argument or a specification; create, delete, rename or move a mapped `.play` document (McpState refuses reopening with `IdentityMappingConflict`; use document operations in `propose-ast`); rename, remove or move an event, command, read model, constraint, module, feature or slice; move declarations between files (slices and features across logical parents: `propose-move`); contract evolution of a persisted event (new generation, property added, removed or retyped) | `propose-rename` or a reviewed `propose-ast`; never a blind text rename. Renaming a constraint resets its uniqueness index: ask first unless the request names it, then report the reset. A persisted event rename needs `id "OldName"` (added by default) |
|
|
199
|
-
|
|
|
204
|
+
| Concept `generate` | set/change/remove strategy and modifiers | `propose-ast` replaces `ConceptSyntax.generation` (`GenerationSyntax`; omit/null to remove), or reviewed `propose-source`; never hand-edit `generate` text. Preserve other concept members and inspect executable diagnostics: sequence PLAY0682, preview strategies/generated-concept rules PLAY0268. |
|
|
205
|
+
| Repair | `PLAY0166`, `0478`, `0469`, `0471`, `0479`, `0516`, `0563`, `0564`, `0565`, `0614`, `0653`, `0683`, `0684` (and recipe-only `0397`) | `propose-repair` with `formatting`; PLAY0166/0478 may pin attachment evidence (`pinRepairEvidence` and `expectedRepairEvidenceRevision`), never fix-all PLAY0478 |
|
|
200
206
|
| Inline event extraction | `produces event ...` to a declared event | `propose-extract-inline-event` |
|
|
201
207
|
| Parser-invalid document | no editable handles | `propose-source` `replace-document` with corrected source, or typed `propose-ast` document replacement |
|
|
202
208
|
| Unadmitted constructs | systems/operations, the `numbers exact` source mode, refusal/redelivery | reviewed Authoring `propose-source` (whole documents) or `propose-ast` (typed edits); preserve intent and report PLAY0268 |
|
|
203
209
|
| Admitted source/stream routing | ESM v8 at 4.125.0 | typed `propose-ast`; `propose-rename` repairs proven route references; target admission separate |
|
|
204
210
|
|
|
211
|
+
PLAY0683/PLAY0684 repairs raise NanoID size or bytes count to at least 64 random
|
|
212
|
+
bits using the concept subject (possibly across documents). PLAY0683 can instead
|
|
213
|
+
add uniqueness when exactly one production maps the command property to exactly
|
|
214
|
+
one event property: use the command-property subject. Discover `repair-capabilities`
|
|
215
|
+
and `read-workspace view: "repairs"`, then `propose-repair` with both revisions and
|
|
216
|
+
`CanonicalizeTouchedDocuments`; review every changed document before apply.
|
|
217
|
+
Neither action supports fix-all or pinned evidence. A concept change affects all
|
|
218
|
+
uses; uniqueness changes append-time behavior. Derived regex, matches/checksum
|
|
219
|
+
repairs and rule-proof status await phase 2b-2; details and source citations are in
|
|
220
|
+
[concept generation](mcp-tools.md#concept-generation-41490).
|
|
221
|
+
|
|
205
222
|
## Self-describing identity migration refusals
|
|
206
223
|
|
|
207
224
|
At Screenplay 4.127.0, read `identityMigrationIssues` on rejected proposals
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
- Tool groups
|
|
9
9
|
- Run reference specifications
|
|
10
10
|
- Whole-source authoring
|
|
11
|
+
- Concept generation (4.149.0)
|
|
11
12
|
- Diagnostic repairs and refactorings
|
|
12
13
|
- Syntax-only constructs through the MCP
|
|
13
14
|
- Descriptions and specification views
|
|
@@ -135,6 +136,80 @@ dropped comments, identity changes and introduced executable errors through
|
|
|
135
136
|
`read-proposal`, then `apply` with before revisions. Accepted authoring source with
|
|
136
137
|
`executableReady: false` is not running behavior.
|
|
137
138
|
|
|
139
|
+
## Concept generation (4.149.0)
|
|
140
|
+
|
|
141
|
+
Inspect `screenplay_declaration_details` (`declaration-details`) with
|
|
142
|
+
`kind: "Concept"`, `view: "summary"` and the concept's address. Its `details.generation`
|
|
143
|
+
exists only for authored `generate`; an implicit UUID default has no block.
|
|
144
|
+
|
|
145
|
+
| Field | Meaning |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| `strategy` | Authored strategy name |
|
|
148
|
+
| `modifiers` | Only set `prefix`, `case`, `size`, `alphabet`, `count`, `encoding`; omitted defaults are not filled in |
|
|
149
|
+
| `previewArguments` | Present only for authored `pattern`, `checksum`, `range`, `rule`; each is `{value, executable: false}` |
|
|
150
|
+
| `entropyBits` | Exact random bits, or null for unknown strategy/invalid entropy inputs |
|
|
151
|
+
| `entropyUnknownReason` | Present only when entropy is unknown |
|
|
152
|
+
| `valuesAtOnePercentCollision` | JSON number estimating the 1% birthday collision count, or null; scientific notation can exceed client floating-point range |
|
|
153
|
+
| `executable` | `status`, `diagnosticCodes`, and `reason` only for `notAssessed` |
|
|
154
|
+
|
|
155
|
+
`executable.status` is `refused` when compiler **errors** target the concept or its
|
|
156
|
+
`generation`; `admitted` only when the whole model produced an executable model
|
|
157
|
+
and no such error exists; otherwise `notAssessed`, with a reason that whole-model
|
|
158
|
+
binding failed. `diagnosticCodes` contains only errors at these two locations.
|
|
159
|
+
An empty list is not admission; low-entropy property diagnostics require workspace
|
|
160
|
+
inspection. Invalid alphabets/non-positive sizes or counts yield null estimates
|
|
161
|
+
with `entropyUnknownReason`, preserving compiler diagnostics. Time, prefixes,
|
|
162
|
+
case and encoding add no randomness; the compiler, details and repairs share
|
|
163
|
+
`GenerationEntropy`, not an agent's parallel estimate.
|
|
164
|
+
|
|
165
|
+
Use MCP proposals, not hand-edited `generate` text. Discover `syntax-schema` and
|
|
166
|
+
read the `ConceptSyntax` handle, then `screenplay_propose_ast` (`propose-ast`)
|
|
167
|
+
`replace` that concept while preserving its other members: set/change its typed
|
|
168
|
+
`generation` (`kind: "GenerationSyntax"`), or omit/null it to remove the strategy.
|
|
169
|
+
`screenplay_propose_source` (`propose-source`) accepts the equivalent complete
|
|
170
|
+
source document under the same revision/review contract. Canonical printing
|
|
171
|
+
retains `generate`. Review `read-proposal` changes and `view: "executable-diagnostics"`,
|
|
172
|
+
run candidate specifications where executable, then explicitly `apply`.
|
|
173
|
+
Authoring acceptance does not imply executable readiness: `sequence` reports
|
|
174
|
+
PLAY0682; `pattern`/`random`/`rule` and generated-concept validation rules report
|
|
175
|
+
PLAY0268. Do not retype a refused proposal to bypass those diagnostics.
|
|
176
|
+
|
|
177
|
+
`screenplay_repair_capabilities` advertises PLAY0683/PLAY0684. Discover concrete
|
|
178
|
+
verified actions with `read-workspace view: "repairs"` at the diagnostic revision:
|
|
179
|
+
|
|
180
|
+
| Code | Selected action and subject |
|
|
181
|
+
| --- | --- |
|
|
182
|
+
| PLAY0683/PLAY0684 | Raise generation to at least 64 random bits: smallest NanoID size for its alphabet, or bytes count 8. Subject is the **concept**, possibly in another document. |
|
|
183
|
+
| PLAY0683 | Add a unique constraint for the generated property: exactly one production maps it to exactly one non-nested event property. Subject is the **command property**; add to its slice. Not offered for identifiers or a colliding constraint name. |
|
|
184
|
+
|
|
185
|
+
Send the returned `diagnosticCode` and `subject` to `screenplay_propose_repair`
|
|
186
|
+
(`propose-repair`) with both revisions and
|
|
187
|
+
`formatting: "CanonicalizeTouchedDocuments"`. Subjects distinguish the two PLAY0683
|
|
188
|
+
actions; there is no extra selector. Both require individual review (`canFixAll: false`),
|
|
189
|
+
with no pinned attachment evidence. A length change affects every use of the
|
|
190
|
+
concept; uniqueness changes append-time behavior. Review every changed document
|
|
191
|
+
before applying; discovery/proposal write nothing. The saved-file VS Code repair
|
|
192
|
+
picker does not expose these entropy actions.
|
|
193
|
+
|
|
194
|
+
Derived regexes, derived `matches`/checksum repairs and rule-proof status are
|
|
195
|
+
**not shipped** in this view (Screenplay#616 phase 2b-2); MCP does not generate values.
|
|
196
|
+
CLI **3.57.0** bundles MCP **4.147.1**: `cratis screenplay mcp` lacks this generation
|
|
197
|
+
summary and entropy repairs. Existing typed concept proposals predate the new
|
|
198
|
+
summary; discover installed schemas rather than assuming the standalone surface.
|
|
199
|
+
|
|
200
|
+
Sources: Cratis/Screenplay **v4.149.0**,
|
|
201
|
+
`Source/DotNET/Screenplay.Mcp/McpGenerationDetails.cs:13-83`,
|
|
202
|
+
`McpDeclarationDetails.cs:160`, `McpRepairCapabilities.cs:10-24`,
|
|
203
|
+
`Source/DotNET/Screenplay/Workspaces/WorkspaceGenerationRepairs.cs:29-134`,
|
|
204
|
+
`Source/DotNET/Screenplay/Semantics/GenerationEntropy.cs:15-60`,
|
|
205
|
+
`Source/DotNET/Screenplay.Mcp/for_McpAuthoringWorkflow/when_authoring_generation.cs:10-97`,
|
|
206
|
+
`when_describing_generation.cs:10-118`, `when_repairing_generation.cs:10-50`;
|
|
207
|
+
`Documentation/screenplay/mcp/reference.md:103-128` and
|
|
208
|
+
`generated-values.md:62-70`. Bundle evidence: Cratis/cli
|
|
209
|
+
`v3.57.0:Directory.Packages.props:8,35-37`; Cratis/Screenplay **v4.147.1**,
|
|
210
|
+
`Source/DotNET/Screenplay.Mcp/McpDeclarationDetails.cs:153-160` and
|
|
211
|
+
`McpRepairCapabilities.cs:10-24`.
|
|
212
|
+
|
|
138
213
|
## Diagnostic repairs and refactorings
|
|
139
214
|
|
|
140
215
|
Check installed `tools/list` before using these capabilities. Read `read-workspace`
|
|
@@ -151,6 +226,7 @@ with `view: "diagnostics"`, then `view: "repairs"` at the current revision.
|
|
|
151
226
|
| `PLAY0563/0564` | Expand a one-line interaction alternative / turn a strict item `where` into one block-form `when`. Individual review, canonical formatting, no pinned evidence; refuse comment loss. Opaque non-item-condition text has no PLAY0564 repair. |
|
|
152
227
|
| `PLAY0614` | Declare Translate direction only when exactly one inbound/outbound interpretation fits public metadata; never change event visibility to make a repair fit. |
|
|
153
228
|
| `PLAY0661` | Complete command reads only when each missing part has one same-named compatible source; preserve authored parts and refuse ambiguity. Queries and trigger reads have no repair. |
|
|
229
|
+
| `PLAY0683/0684` | Raise NanoID size/bytes count using the concept subject; PLAY0683 also offers uniqueness using the command-property subject. Individual review, canonical formatting, no pinned evidence; see [concept generation](#concept-generation-41490). |
|
|
154
230
|
| `PLAY0664` | Remove an override identical to the command's complete source/stream/id route. |
|
|
155
231
|
| `PLAY0516` | Move a producing sibling declaration/import before its consumer, or pin an already placed file before a retained glob. Preserve catalogs, comments, placement and executable readiness; introduce no timeline findings. Own-sub-feature edges, cycles, unranked members and mixed/different-parent boundaries have no repair. Rediscover after each move; pinned evidence is unsupported. |
|
|
156
232
|
|
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
6
|
{ "kind": "play-compiles" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "Edit through MCP proposals, not hand-edited text" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "CLI 3.57.0 bundles MCP 4.147.1" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "`previewArguments`", "file": "references/mcp-tools.md" },
|
|
10
|
+
{ "kind": "skill-contains", "value": "`entropyUnknownReason`", "file": "references/mcp-tools.md" },
|
|
11
|
+
{ "kind": "skill-contains", "value": "`valuesAtOnePercentCollision`", "file": "references/mcp-tools.md" },
|
|
12
|
+
{ "kind": "skill-contains", "value": "`notAssessed`", "file": "references/mcp-tools.md" },
|
|
13
|
+
{ "kind": "skill-contains", "value": "omit/null it to remove", "file": "references/mcp-tools.md" },
|
|
14
|
+
{ "kind": "skill-contains", "value": "screenplay_propose_repair", "file": "references/mcp-tools.md" },
|
|
15
|
+
{ "kind": "skill-contains", "value": "Subject is the **concept**", "file": "references/mcp-tools.md" },
|
|
16
|
+
{ "kind": "skill-contains", "value": "Subject is the **command property**", "file": "references/mcp-tools.md" },
|
|
17
|
+
{ "kind": "skill-contains", "value": "**not shipped**", "file": "references/mcp-tools.md" },
|
|
18
|
+
{ "kind": "skill-contains", "value": "never hand-edit `generate` text", "file": "references/mcp-loop.md" },
|
|
7
19
|
{ "kind": "skill-contains", "value": "Record open modeling questions as `question` notes" },
|
|
8
20
|
{ "kind": "skill-contains", "value": "list-model-notes", "file": "references/model-notes.md" },
|
|
9
21
|
{ "kind": "skill-contains", "value": "`anchor`", "file": "references/model-notes.md" },
|
|
@@ -178,7 +178,7 @@ on the header line is a declaration error, not a shorthand.
|
|
|
178
178
|
|
|
179
179
|
### What runs
|
|
180
180
|
|
|
181
|
-
These bind on standalone 4.
|
|
181
|
+
These bind on standalone 4.149.0: keyed `=> RM optional`, unfiltered collections,
|
|
182
182
|
collections narrowed by caller-supplied `by`, and their `observable` forms.
|
|
183
183
|
Caller-supplied equality filters on collections select ESM v14: same-named scalar
|
|
184
184
|
primitive/concept/enum properties, same nominal type ignoring optionality, no
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- Rendering is a different verdict
|
|
12
12
|
- Verified product sources
|
|
13
13
|
|
|
14
|
-
Screenplay **4.143.0 and later**, including the standalone **4.
|
|
14
|
+
Screenplay **4.143.0 and later**, including the standalone **4.149.0** pin,
|
|
15
15
|
binds `filter <name> <Type> [optional]` on a collection query when:
|
|
16
16
|
|
|
17
17
|
- there is no `from` source;
|
|
@@ -110,7 +110,7 @@ model still compiles and binds) and its V5 states the scope.
|
|
|
110
110
|
`--project-name`, `--root-namespace` and target `cratis`. Take V1 and V3 from
|
|
111
111
|
`cratis-screenplay-toolchain`; report each with tool and version. V3 from a different
|
|
112
112
|
compiler version does not prove the cratis-bundled binder admits the model (the bundle is
|
|
113
|
-
4.147.1, the standalone tool 4.
|
|
113
|
+
4.147.1, the standalone tool 4.149.0). `cratis screenplay validate --executable <root>` binds with
|
|
114
114
|
the bundled compiler and writes nothing: use it as the bundled-binder check (toolchain `references/verdicts.md`).
|
|
115
115
|
2. **Probe.** `cratis render <model-root> --name <App> --destination <probe-dir> -o json`
|
|
116
116
|
(exit 0 published, 5 refused with nothing published, 1 missing input); add `--check` to plan
|
package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md
CHANGED
|
@@ -30,7 +30,7 @@ per tool call and read each result from its exit status, never from a grep of th
|
|
|
30
30
|
| --- | --- | --- |
|
|
31
31
|
| Admission and publication | `cratis render <root> --name <App> --destination <dir> [--project-name <P>] [--root-namespace <N>] -o json` (forward every option recorded in section 1) | exit 0 published (receipt on stdout), 5 refused (diagnostics, nothing published), 1 missing input |
|
|
32
32
|
| Drift or pending-change check | the same command plus `--check` (and `--scope`, `--force` as used) | no write, no recovery: exit 0 current, 6 `changes_pending`, 5 planning failure, refusal or pending recovery |
|
|
33
|
-
| Bundled-binder check | `cratis screenplay validate --executable <root>` | exit 5 with "does not bind into an executable semantic model" when it does not; never renders or writes. Uses the bundled compiler (CLI 3.57.0 = Screenplay 4.147.1), not standalone 4.
|
|
33
|
+
| Bundled-binder check | `cratis screenplay validate --executable <root>` | exit 5 with "does not bind into an executable semantic model" when it does not; never renders or writes. Uses the bundled compiler (CLI 3.57.0 = Screenplay 4.147.1), not standalone 4.149.0 |
|
|
34
34
|
| Debug build | `dotnet build <dir>/<Project>.csproj -c Debug` | the build's exit status |
|
|
35
35
|
| Debug tests | `dotnet test <dir>/<Project>.csproj -c Debug --no-build` | the test runner's exit status plus per-test results |
|
|
36
36
|
| List the generated classes | `dotnet test <dir>/<Project>.csproj -c Debug --no-build --list-tests` | the names to map to specifications |
|
|
@@ -24,7 +24,7 @@ files is one application: always check the folder, never one file of it.
|
|
|
24
24
|
|
|
25
25
|
When choosing or upgrading a tool, or checking version-specific capabilities, read `references/versions.md`; it is the only version table, and other skills point to it. For exact diagnostic codes, MCP names/parameters and standalone CLI options, search the large published [references/screenplay-contract.json](references/screenplay-contract.json), pinned by [references/screenplay-contract.version](references/screenplay-contract.version), rather than loading it in full. Locate a diagnostic by its exact `code` (for example `"code": "PLAY0029"`), a tool by its exact `name` (for example `"name": "read-workspace"`), or a command in `cliCommands`; read the matched object for retirement, parameters or options. [references/screenplay-contract-exceptions.json](references/screenplay-contract-exceptions.json) records reasoned exceptions for historical statements; it does not change the current contract.
|
|
26
26
|
|
|
27
|
-
The standalone pin is Screenplay 4.
|
|
27
|
+
The standalone pin is Screenplay 4.149.0.
|
|
28
28
|
CLI and bundled package pins: `references/versions.md`. The single version table records
|
|
29
29
|
released source evidence and historical probes separately; do not relabel an old
|
|
30
30
|
render/browser result as a probe of the current packages.
|
|
@@ -46,7 +46,7 @@ or the current standalone pin.
|
|
|
46
46
|
3. **Pick the compiler deliberately and name it.** Standalone `screenplay` for
|
|
47
47
|
current language checks and reference specifications; `cratis` for rendering
|
|
48
48
|
and generation. Bundled and standalone versions differ (CLI 3.57.0 bundles 4.147.1;
|
|
49
|
-
the standalone pin is 4.
|
|
49
|
+
the standalone pin is 4.149.0). Report both tool and
|
|
50
50
|
version, rather than transferring a verdict across releases.
|
|
51
51
|
4. **Know the mode** (design, executable, renderable) and write from its subset.
|
|
52
52
|
5. **Capability is not correctness.** The tool you ran decides what is accepted today; the
|
|
@@ -24,7 +24,7 @@ reaction refusals/redelivery remain unadmitted. Use the actual
|
|
|
24
24
|
binder before promoting an older probe to a current capability claim.
|
|
25
25
|
|
|
26
26
|
What the binder admits, and what it refuses with which code. The answer depends on the
|
|
27
|
-
compiler version: the standalone tool (4.
|
|
27
|
+
compiler version: the standalone tool (4.149.0) binds through v15; the compiler bundled in cratis
|
|
28
28
|
3.57.0 (4.147.1) and its renderer admit through v15; older bundles (4.66.0 in cratis 3.28.x, admitting v1 to v6; 4.60.1 before 3.28.2, v1 to v5)
|
|
29
29
|
are history.
|
|
30
30
|
Tool facts and the exact v6 messages: `versions.md`. Always name
|
|
@@ -107,7 +107,7 @@ same-named scalar primitive/concept/enum property of the same nominal type
|
|
|
107
107
|
filters AND with `by`; optional omission does not narrow, supplied null is refused.
|
|
108
108
|
`then query … arguments` and `when query` accept both `by` and filters; PLAY0468
|
|
109
109
|
reports unknown/repeated/missing required arguments. Collection results match by
|
|
110
|
-
read model/key regardless of row order. The standalone 4.
|
|
110
|
+
read model/key regardless of row order. The standalone 4.149.0 pin admits this;
|
|
111
111
|
CLI 3.57.0's 4.147.1 compiler and Stage 4.89.1 admit it through v15, subject to
|
|
112
112
|
construct checks (snapshot lists/DateTime filters/parameter order still refuse). Complete compiled specs:
|
|
113
113
|
read-surface [equality filters](../../cratis-screenplay-read-surface/references/equality-filters.md).
|
package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.149.0
|
|
@@ -53,7 +53,7 @@ V3 are read from the MCP server or from a render, V1 and V5 from the CLIs.
|
|
|
53
53
|
Needs an MCP connection (V2 and V3 belong to the session that owns MCP; a subagent without
|
|
54
54
|
MCP reports `V2 not run: no MCP in this agent` unless the brief supplies fresh output). Without
|
|
55
55
|
MCP, a binding check exists: `cratis screenplay validate --executable <root>` binds with the
|
|
56
|
-
**bundled** compiler (CLI 3.57.0 bundles Screenplay 4.147.1, not standalone 4.
|
|
56
|
+
**bundled** compiler (CLI 3.57.0 bundles Screenplay 4.147.1, not standalone 4.149.0), never
|
|
57
57
|
renders or writes files, and exits 5 with "The model does not bind into an executable semantic
|
|
58
58
|
model" when it does not. Report it as `V3 (bundled 4.137.0 via cratis validate --executable)`; it
|
|
59
59
|
gives binding errors, not the V2 `executable-diagnostics` view, so V2 stays MCP-only.
|
|
@@ -19,9 +19,9 @@ probe; older probes retain their original labels in the other references.
|
|
|
19
19
|
|
|
20
20
|
| Source | Pin | Evidence |
|
|
21
21
|
| --- | --- | --- |
|
|
22
|
-
| Screenplay language, standalone tool and MCP | **4.
|
|
22
|
+
| Screenplay language, standalone tool and MCP | **4.149.0** | Released tag `v4.149.0`, published NuGet tool and byte-identical Golden contract; concept generation MCP summary/entropy repairs, retaining ESM v15 and 4.148.0 response-name resolution |
|
|
23
23
|
| cratis CLI | **3.57.0** | Released tag `v3.57.0`; source-checked, not a new render/browser probe |
|
|
24
|
-
| Screenplay bundled by CLI | **4.147.1** | CLI `v3.57.0:Directory.Packages.props:8`; binds through v15; does not include 4.148.0 response-name continuation resolution |
|
|
24
|
+
| Screenplay bundled by CLI | **4.147.1** | CLI `v3.57.0:Directory.Packages.props:8`; binds through v15; does not include 4.148.0 response-name continuation resolution or 4.149.0 generation summary/entropy repairs |
|
|
25
25
|
| Stage bundled by CLI | **4.89.1** | Same file, line 10; Stage `v4.89.1:Directory.Packages.props` pins Screenplay 4.147.1; rendering admits through v15 |
|
|
26
26
|
| Historical standalone Stage source baseline | **4.76.0** (Screenplay 4.139.0) | First v12 enum-number rendering; generated UUID-concept values and responses shipped in 4.74.0, v11 admission in 4.75.0. Those capabilities are now in the CLI bundle; standalone Stage beyond the bundled release is not this baseline |
|
|
27
27
|
| Screenplay.Generation / CritterStack / Prologue bundled by CLI | **0.18.0 / 0.24.0 / 2.0.0** | CLI `v3.57.0:Directory.Packages.props:5-7,28-33`. Latest released: Generation 0.18.1, CritterStack 0.26.0, Prologue 2.0.0 (no release after 2.0.0); the newer Generation and CritterStack releases are not in a cli |
|
|
@@ -56,7 +56,7 @@ or renderer probes below as results from the newer bundle.
|
|
|
56
56
|
## Equality-filter rendering boundary
|
|
57
57
|
|
|
58
58
|
Caller-supplied collection equality filters shipped in Screenplay **4.143.0**
|
|
59
|
-
(decision 0069), selecting ESM v14; the standalone **4.
|
|
59
|
+
(decision 0069), selecting ESM v14; the standalone **4.149.0** pin binds and
|
|
60
60
|
reference-tests them. No-filter models retain their version/bytes/revision.
|
|
61
61
|
CLI **3.57.0** bundles Screenplay **4.147.1** / Stage **4.89.1** and renders
|
|
62
62
|
collection equality filters, including optional omission and AND with `by`.
|
|
@@ -71,7 +71,7 @@ read-surface [equality filters](../../cratis-screenplay-read-surface/references/
|
|
|
71
71
|
|
|
72
72
|
## Two compilers, one rule
|
|
73
73
|
|
|
74
|
-
Standalone Screenplay 4.
|
|
74
|
+
Standalone Screenplay 4.149.0 and CLI 3.57.0's 4.147.1 bundle are different releases.
|
|
75
75
|
Prefer standalone for the current language checks; CLI owns generation, Prologue
|
|
76
76
|
and rendering. Name the tool/version with every verdict. No verdict transfers
|
|
77
77
|
between differing compilers without checking the same inputs there.
|
|
@@ -83,7 +83,13 @@ Do not treat a clean fragment or scoped result as whole-application success.
|
|
|
83
83
|
MCP server launch: `screenplay mcp <model-root>` or
|
|
84
84
|
`cratis screenplay mcp <model-root>`. Discover `tools/list`, views and schemas
|
|
85
85
|
rather than counting tools. Connection, worktree switching and root-state
|
|
86
|
-
conflicts: `cratis-screenplay-model-authoring`.
|
|
86
|
+
conflicts: `cratis-screenplay-model-authoring`. CLI 3.57.0's MCP 4.147.1 lacks
|
|
87
|
+
4.149.0's concept generation summary and PLAY0683/PLAY0684 repairs. Source:
|
|
88
|
+
Cratis/cli `v3.57.0:Directory.Packages.props:8,35-37`; Cratis/Screenplay
|
|
89
|
+
`v4.147.1:Source/DotNET/Screenplay.Mcp/McpDeclarationDetails.cs:153-160` and
|
|
90
|
+
`McpRepairCapabilities.cs:10-24`. The standalone generation fields and repairs
|
|
91
|
+
are source-checked at `v4.149.0:McpGenerationDetails.cs:13-83` under the same MCP
|
|
92
|
+
source folder; detailed evidence: model-authoring `references/mcp-tools.md`.
|
|
87
93
|
|
|
88
94
|
## Commands and exit codes
|
|
89
95
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
{ "kind": "skill-contains", "value": "**Published v15 in 4.147.0:**", "file": "references/versions.md" },
|
|
48
48
|
{ "kind": "skill-contains", "value": "protected identities/enums (`-040`)", "file": "references/renderable-subset.md" },
|
|
49
49
|
{ "kind": "skill-contains", "value": "PLAY0514" },
|
|
50
|
-
{ "kind": "skill-contains", "value": "**4.
|
|
50
|
+
{ "kind": "skill-contains", "value": "**4.149.0**", "file": "references/versions.md" },
|
|
51
51
|
{ "kind": "skill-contains", "value": "RejectsAUsedGeneratedSource", "file": "references/generation-strategies-example.md" },
|
|
52
52
|
{ "kind": "skill-contains", "value": "bind as ESM v8" },
|
|
53
53
|
{ "kind": "skill-contains", "value": "PLAY0530/0531", "file": "references/diagnostics.md" },
|