@hassangameryt/freeflow 0.6.0 → 0.7.1

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.
Files changed (136) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +3 -2
  3. package/.codex-plugin/plugin.json +5 -6
  4. package/.cursor-plugin/plugin.json +25 -0
  5. package/README.md +66 -56
  6. package/capabilities/cognitive-routing/SKILL.md +288 -130
  7. package/com.github.copilot/hooks/hooks.json +11 -0
  8. package/command-surface.json +0 -24
  9. package/gemini-extension.json +5 -0
  10. package/hooks/adapters/claude-session-start.mjs +16 -0
  11. package/hooks/adapters/codex-session-start.mjs +16 -0
  12. package/hooks/adapters/copilot-session-start.mjs +13 -0
  13. package/hooks/adapters/cursor-session-start.mjs +13 -0
  14. package/hooks/adapters/gemini-session-start.mjs +15 -0
  15. package/hooks/claude/hooks.json +18 -0
  16. package/hooks/codex/hooks.json +18 -0
  17. package/hooks/cursor/hooks.json +9 -0
  18. package/hooks/freeflow-runtime-context.mjs +3 -650
  19. package/hooks/hooks.json +4 -30
  20. package/hooks/shared/runtime-context.mjs +210 -0
  21. package/hooks/tests/check-host-adapters.test.mjs +82 -0
  22. package/hooks/tests/check-runtime-context-hook.sh +140 -320
  23. package/package.json +20 -4
  24. package/pi-extension/dist/cognitive-routing/commands.js +3 -3
  25. package/pi-extension/dist/cognitive-routing/config.js +16 -20
  26. package/pi-extension/dist/cognitive-routing/controller.js +478 -48
  27. package/pi-extension/dist/cognitive-routing/history.js +12 -0
  28. package/pi-extension/dist/cognitive-routing/host.js +74 -12
  29. package/pi-extension/dist/cognitive-routing/pi-routing-session.js +414 -0
  30. package/pi-extension/dist/cognitive-routing/pi-session-control.js +320 -0
  31. package/pi-extension/dist/cognitive-routing/tool.js +1 -0
  32. package/pi-extension/dist/cognitive-routing/types.js +1 -1
  33. package/pi-extension/dist/index.js +236 -219
  34. package/pi-extension/dist/runtime/runtime-context.js +126 -286
  35. package/pi-extension/dist/settings/settings-ui.js +52 -336
  36. package/pi-extension/src/cognitive-routing/commands.ts +15 -5
  37. package/pi-extension/src/cognitive-routing/config.ts +16 -20
  38. package/pi-extension/src/cognitive-routing/controller.ts +561 -51
  39. package/pi-extension/src/cognitive-routing/history.ts +12 -0
  40. package/pi-extension/src/cognitive-routing/host.ts +110 -16
  41. package/pi-extension/src/cognitive-routing/pi-routing-session.ts +538 -0
  42. package/pi-extension/src/cognitive-routing/pi-session-control.ts +444 -0
  43. package/pi-extension/src/cognitive-routing/tool.ts +1 -0
  44. package/pi-extension/src/cognitive-routing/types.ts +1 -1
  45. package/pi-extension/src/index.ts +249 -239
  46. package/pi-extension/src/runtime/runtime-context.ts +129 -305
  47. package/pi-extension/src/settings/settings-ui.ts +53 -371
  48. package/pi-extension/tests/cognitive-routing/commands.test.js +1 -1
  49. package/pi-extension/tests/cognitive-routing/controller.test.js +69 -40
  50. package/pi-extension/tests/cognitive-routing/extension-lifecycle.test.js +128 -57
  51. package/pi-extension/tests/cognitive-routing/pi-normal-lifecycle.test.js +434 -0
  52. package/pi-extension/tests/cognitive-routing/pi-session-control.test.js +174 -0
  53. package/pi-extension/tests/cognitive-routing/pi-session-history.test.js +91 -0
  54. package/pi-extension/tests/cognitive-routing/profile-resolution.test.js +47 -4
  55. package/pi-extension/tests/integration/mode-free-core.test.js +218 -0
  56. package/pi-extension/tests/integration/pi-extension.test.js +430 -2478
  57. package/pi-extension/tests/integration/prompt-architecture.test.js +124 -79
  58. package/pi-extension/tests/integration/unaffected-regressions.test.js +411 -0
  59. package/plugin.json +33 -0
  60. package/runtime/prompts/cognitive-routing.md +5 -4
  61. package/runtime/prompts/conversation-history.md +1 -1
  62. package/runtime/prompts/core.md +77 -6
  63. package/runtime/prompts/interaction-contract.md +6 -2
  64. package/skills/action-selection/SKILL.md +93 -44
  65. package/skills/action-selection/references/trajectory-stalls.md +71 -0
  66. package/skills/bypass/SKILL.md +109 -39
  67. package/skills/commit-work/SKILL.md +94 -55
  68. package/skills/commit-work/references/git-state-edges.md +94 -0
  69. package/skills/commit-work/references/simple-push.md +92 -0
  70. package/skills/commit-work/references/staging-decisions.md +79 -46
  71. package/skills/decision-gate/SKILL.md +80 -22
  72. package/skills/design-for-depth/SKILL.md +208 -43
  73. package/skills/design-for-depth/references/design-pressure-signals.md +108 -240
  74. package/skills/design-for-depth/references/interface-design-loop.md +77 -97
  75. package/skills/design-for-depth/references/module-and-dependency-design.md +147 -0
  76. package/skills/design-for-depth/references/software-design-philosophy.md +127 -173
  77. package/skills/design-for-depth/references/state-and-failure-boundaries.md +136 -0
  78. package/skills/diagnose-failure/SKILL.md +198 -52
  79. package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +19 -5
  80. package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +13 -5
  81. package/skills/discuss/SKILL.md +118 -76
  82. package/skills/discuss/references/discussion-continuity.md +84 -32
  83. package/skills/evaluate-skill/SKILL.md +166 -52
  84. package/skills/evaluate-skill/references/evaluation-definition-schema.md +2 -2
  85. package/skills/evaluate-skill/references/evaluation-design.md +56 -30
  86. package/skills/evaluate-skill/references/execution-and-evidence.md +1 -1
  87. package/skills/evaluate-skill/references/review-and-revision.md +62 -21
  88. package/skills/execute-work/SKILL.md +98 -59
  89. package/skills/execute-work/references/code-practices.md +4 -4
  90. package/skills/execute-work/references/execute-work-edges.md +42 -22
  91. package/skills/review-artifact/SKILL.md +132 -71
  92. package/skills/review-artifact/references/adjudicate-artifact-review.md +101 -0
  93. package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +52 -41
  94. package/skills/review-work/SKILL.md +115 -72
  95. package/skills/review-work/references/adjudicate-work-review.md +97 -0
  96. package/skills/review-work/references/independent-work-reviewer-contract.md +40 -35
  97. package/skills/review-work/references/security-risk-lens.md +17 -15
  98. package/skills/setup-freeflow/SKILL.md +14 -17
  99. package/skills/setup-freeflow/references/activation-contract.md +24 -30
  100. package/skills/setup-freeflow/references/host-setup.md +6 -7
  101. package/skills/simplify-code/SKILL.md +97 -39
  102. package/skills/simplify-code/references/simplification-patterns.md +1 -1
  103. package/skills/tdd/SKILL.md +108 -41
  104. package/skills/tdd/references/test-design.md +1 -1
  105. package/skills/track-work/SKILL.md +133 -300
  106. package/skills/track-work/references/working-record-format.md +515 -0
  107. package/skills/track-work/scripts/lib/document.mjs +713 -0
  108. package/skills/track-work/scripts/lib/format.mjs +166 -0
  109. package/skills/track-work/scripts/lib/store.mjs +233 -0
  110. package/skills/track-work/scripts/lib/transitions.mjs +790 -0
  111. package/skills/track-work/scripts/lib/views.mjs +27 -430
  112. package/skills/track-work/scripts/working-record.mjs +292 -98
  113. package/skills/verify-work/SKILL.md +46 -20
  114. package/skills/verify-work/references/browser-runtime-evidence.md +1 -1
  115. package/skills/verify-work/references/integration-evidence.md +1 -7
  116. package/skills/verify-work/references/performance-evidence.md +1 -1
  117. package/skills/workflow/SKILL.md +110 -80
  118. package/skills/workflow/references/domain-skill-composition.md +24 -18
  119. package/skills/write-skill/SKILL.md +218 -62
  120. package/skills/write-skill/references/activation-boundaries.md +63 -21
  121. package/skills/write-skill/references/agent-first-instructions.md +61 -27
  122. package/skills/write-skill/references/progressive-disclosure.md +91 -41
  123. package/skills/write-skill/references/skill-dependency-graphs.md +190 -0
  124. package/runtime/prompts/skills.md +0 -65
  125. package/skills/mode-contract/SKILL.md +0 -104
  126. package/skills/track-work/scripts/lib/codec.mjs +0 -570
  127. package/skills/track-work/scripts/lib/commands.mjs +0 -568
  128. package/skills/track-work/scripts/lib/contract.mjs +0 -303
  129. package/skills/track-work/scripts/lib/model.mjs +0 -506
  130. package/skills/track-work/scripts/lib/operations.mjs +0 -965
  131. package/skills/track-work/scripts/lib/record-store.mjs +0 -264
  132. package/skills/track-work/scripts/lib/result.mjs +0 -37
  133. package/skills/track-work/scripts/lib/rewrites.mjs +0 -740
  134. package/skills/track-work/scripts/lib/schema.mjs +0 -277
  135. package/skills/track-work/scripts/lib/source-inventory.mjs +0 -162
  136. package/skills/track-work/scripts/lib/workspace.mjs +0 -134
@@ -5,71 +5,126 @@ description: Use when evaluating or comparing agent-skill behavior.
5
5
 
6
6
  # Evaluate Skill
7
7
 
8
- Evaluate whether an exact skill changes agent behavior as intended under declared pressure. Evidence outranks confident prose.
8
+ Determine whether an exact skill package changes agent behavior as intended under declared pressure. Evidence outranks confident prose.
9
9
 
10
10
  A **group** asks one behavioral question through exactly two variants:
11
11
 
12
- - `baseline`: no target skill or a previous snapshot;
13
- - `candidate`: a new or updated snapshot.
12
+ - `baseline`: no target skill for a new skill, or one exact immutable previous package for a revision;
13
+ - `candidate`: one exact new or updated package.
14
14
 
15
- The **subject** performs the declared task under one variant. A **suite** is an ordered batch of groups. The evaluator runs subjects, preserves canonical evidence, appends deterministic grades, and renders views. It does not decide whether a skill is good, ready, promotable, or suitable for production.
15
+ The **subject** performs the declared task under one variant. The **evaluator** isolates subjects and preserves canonical evidence. The **deterministic grader** derives fixed mechanical facts after run persistence. A **suite** runs an ordered set of independent groups.
16
16
 
17
- Inline examples teach the subject. They are candidate content, not evaluation evidence. Keep criteria and expected outcomes outside natural prompts.
17
+ Evaluate Skill does not author or revise skills, decide semantic quality, claim readiness, or choose publication. [Write Skill](../write-skill/SKILL.md) owns package preservation and revision. The active agent or user judges unresolved meaning. The user decides whether to revise, use, publish, or reject the skill.
18
18
 
19
- ## Route First
19
+ Inline examples teach the subject and are part of the candidate intervention. They are not independent evaluation evidence. Keep deterministic criteria and review questions outside natural subject prompts.
20
20
 
21
- - Inspect adequate saved evidence before proposing a rerun or wording change.
22
- - Reuse an existing group unchanged when it preserves the question, pressure, and fixed criteria.
23
- - For a draft-only request, use [Write Skill](../write-skill/SKILL.md); do not fake a run.
24
- - Preserve partial infrastructure evidence without treating unavailable behavior as pass or fail.
25
- - Do not mutate canonical evidence or erase an unfavorable result.
21
+ ## Route From Existing Evidence First
26
22
 
27
- Before a substantial rewrite, snapshot the complete current skill package and record an exact identity before editing; use that immutable state as the baseline. A small local wording correction needs no extra snapshot when its exact prior state is already recoverable and the change remains local.
23
+ Before proposing a run or revision:
28
24
 
29
- ## Name One Question
25
+ - inspect adequate saved evidence;
26
+ - reuse an existing group unchanged when it still preserves the question, pressure, variants, and fixed criteria;
27
+ - use saved views and raw artifact reads when a complete result already answers the question;
28
+ - preserve partial infrastructure evidence without converting unavailable behavior into pass or fail;
29
+ - do not mutate canonical evidence or erase an unfavorable result.
30
30
 
31
- Separate the behavior being examined:
31
+ For a draft-only request, use Write Skill. Do not fabricate behavioral evidence.
32
32
 
33
- - **Description activation:** did a natural prompt cause an exact target read, and when?
34
- - **First-read body behavior:** did explicit body delivery guide the subject with only guaranteed context?
33
+ A revision comparison requires an exact immutable baseline identity. If none exists, return to Write Skill to preserve the complete current package before revision. Evaluate Skill consumes baseline and candidate identities; it does not create a baseline by editing the package it is evaluating.
34
+
35
+ ## Name One Behavioral Question
36
+
37
+ Name the exact claim and observing mechanism before choosing the group shape.
38
+
39
+ Evidence classes include:
40
+
41
+ - **Description activation:** did a natural prompt cause the exact target to be read, and when?
42
+ - **First-read body behavior:** did explicit body delivery guide the subject using only guaranteed context?
35
43
  - **Nearby behavior:** did a close case avoid activation or load without hijacking the task?
36
44
  - **Dependency composition:** did exact ordered skills, resources, and context work together?
37
- - **Retained use:** did guidance remain useful on later declared turns?
38
- - **Artifact outcome:** did files, state, events, and responses match the fixed criterion?
39
- - **Cross-host behavior:** did the same question hold on every named host?
45
+ - **Retained use:** did guidance remain useful on later declared turns without redelivery?
46
+ - **Artifact outcome:** did files, structured state, events, and responses match fixed criteria?
47
+ - **Cross-host behavior:** did the same behavioral question hold on every named host?
48
+
49
+ One evidence class does not prove another.
50
+
51
+ ```text
52
+ successful read
53
+ ≠ behavioral compliance
54
+
55
+ explicit body delivery
56
+ ≠ natural activation
57
+
58
+ one turn
59
+ ≠ retained use
60
+
61
+ ambient installation
62
+ ≠ declared composition
63
+
64
+ correct behavior
65
+ ≠ proof that the target caused it
66
+ ```
67
+
68
+ Read [Evaluation Design](references/evaluation-design.md) before choosing or materially changing the question, evidence class, group shape, pressure, or baseline/candidate boundary.
69
+
70
+ ## Design The Smallest Valid Comparison
71
+
72
+ Before subject output exists:
73
+
74
+ 1. fix one behavioral question;
75
+ 2. fix deterministic expectations and review questions;
76
+ 3. preserve the earliest natural prompt or strongest pressure capable of distinguishing behavior;
77
+ 4. declare exact baseline and candidate identities;
78
+ 5. keep prompt or turns, fixture, tools, model, thinking, other skills, context, runtime, and criteria fixed except for the target difference;
79
+ 6. run one group or an ordered suite serially;
80
+ 7. inspect canonical evidence and deterministic facts before judging meaning;
81
+ 8. classify the failed boundary before proposing revision;
82
+ 9. return one measured revision target to Write Skill;
83
+ 10. rerun the complete fixed group with both variants after a behavioral change.
84
+
85
+ For a new skill:
86
+
87
+ ```text
88
+ baseline: no target skill
89
+ candidate: exact candidate package
90
+ ```
40
91
 
41
- One evidence class does not prove another. A successful read does not prove compliance. Direct body delivery cannot prove natural activation. One turn cannot prove retained use. Ambient installation cannot prove declared composition.
92
+ For a revision:
42
93
 
43
- Read [evaluation design](references/evaluation-design.md) when choosing the question, evidence class, group shape, or variant boundary.
94
+ ```text
95
+ baseline: exact previous package
96
+ candidate: exact revised package
97
+ ```
44
98
 
45
- Keep description and body questions separate by default. `end-to-end` is reserved for an integrated activation-plus-behavior question, but the current runner rejects it before subject execution.
99
+ For a description-only revision, keep body, references, scripts, and other resources byte-identical.
46
100
 
47
- Two common boundary examples:
101
+ If both variants pass, the pressure may be weak or the baseline already sufficient. If both fail, distinguish skill, fixture, dependency, environment, host, isolation, and criterion failures before revising instructions.
48
102
 
49
- - If a complete saved result already answers the question, use `view` and raw artifact reads; do not rerun merely to demonstrate process.
50
- - If explicit body delivery succeeds but a natural prompt never reads the skill, body behavior is supported while description activation still fails.
103
+ ## Declare The Complete Environment
51
104
 
52
- ## Use The Smallest Valid Loop
105
+ Use the exact [Evaluation Definition Schema](references/evaluation-definition-schema.md) when authoring or checking group and suite JSON.
53
106
 
54
- 1. Fix the group question, deterministic criteria, and review questions before subject output exists.
55
- 2. Preserve the earliest natural prompt or strongest pressure that should distinguish behavior.
56
- 3. For a new skill, use no target versus candidate. For a revision, use exact previous versus updated snapshots. For a description-only revision, keep body and resources byte-identical.
57
- 4. Keep prompts or turns, fixture, tools, model, thinking, other skills, context, and criteria fixed except for the target difference.
58
- 5. Run one group or an ordered suite serially.
59
- 6. Inspect deterministic facts and canonical evidence before judging meaning.
60
- 7. Let the active agent or user review unresolved behavior; never launch an automatic semantic grader.
61
- 8. Classify the failed boundary before editing and revise one measured pressure point.
62
- 9. Rerun the complete fixed group with both variants after a measured change.
107
+ Declare:
63
108
 
64
- If both variants pass, the pressure may be weak or the baseline sufficient. If both fail, distinguish the skill, fixture, environment, host, dependency, or criterion before editing.
109
+ - prompt or ordered turns;
110
+ - fixture;
111
+ - exact ordered skill packages and target index;
112
+ - working-tree or Git source identity;
113
+ - context resources;
114
+ - tools;
115
+ - model and thinking;
116
+ - runtime host and extension bundles when needed;
117
+ - literal and inherited environment sources;
118
+ - deterministic expectations and comparison IDs;
119
+ - review questions.
65
120
 
66
- ## Declare The Definition
121
+ Snapshot every declared subject resource. Ambient installation is not declared composition.
67
122
 
68
- Use the exact [Evaluation Definition Schema](references/evaluation-definition-schema.md) for group, environment, expectation, suite, and selector shapes.
123
+ Criteria and review questions remain outside the subject prompt.
69
124
 
70
- Declare the prompt or turns, fixture, exact ordered skills and target, working-tree or Git source, runtime host/session mode and ordered extension bundles when needed, literal/inherited environment sources, UTF-8 context, tools, model and thinking, deterministic expectations, comparison IDs, and review questions. Snapshot every declared subject resource. Ambient installation is not declared composition.
125
+ ## Run And Preserve Canonical Evidence
71
126
 
72
- ## Run And View
127
+ Before operating the evaluator, resolving paths, interpreting states, or reasoning about host execution, read [Execution and Evidence](references/execution-and-evidence.md).
73
128
 
74
129
  Use the canonical [skill evaluator](scripts/skill-eval.mjs):
75
130
 
@@ -78,28 +133,87 @@ node <evaluate-skill-directory>/scripts/skill-eval.mjs run <suite-or-group-path>
78
133
  node <evaluate-skill-directory>/scripts/skill-eval.mjs view <result-id-or-directory> [--group <id-or-position>] [--variant baseline|candidate]
79
134
  ```
80
135
 
81
- Run from the definition root. Definition targets resolve from the current working directory; suite group references resolve from the suite file. Results are stored under `<cwd>/.skill-eval/runs/<result-id>`. `view` accepts a stored result ID or explicit result directory.
136
+ Run from the definition root.
137
+
138
+ With no selectors, run or view every suite group and both variants. Selectors narrow execution or viewing scope; they do not modify definitions.
139
+
140
+ Canonical results live under:
141
+
142
+ ```text
143
+ <definition-root>/.skill-eval/runs/<result-id>
144
+ ```
145
+
146
+ A view is a projection of saved evidence, not its canonical source. Use ordinary file tools when exact run, event, transcript, response, stderr, workspace, definition, grade, context-observation, or group artifacts matter.
147
+
148
+ Do not invoke archived evaluators.
149
+
150
+ ## Derive Facts Without Inventing Meaning
82
151
 
83
- With no selectors, every suite group and both variants are selected. `--group` is invalid for a direct group. Run `--help` before relying on an operation.
152
+ Append deterministic grades only after canonical run evidence exists.
84
153
 
85
- Pi is the direct subject process; a runtime profile may select the compatible `piflow` command as an explicit host variant. One-shot descriptions use fresh JSON-mode subjects. Ordered description turns and body groups use one isolated RPC process per variant. Body groups explicitly deliver one target on turn one. Declared extension bundles may provide non-native custom tools in body groups and context injections; description groups remain limited to no tools or `read`. Native `bash`, `powershell`, `grep`, `find`, and `ls` tools, definition-supplied command execution, and end-to-end execution are unsupported.
154
+ Deterministic checks may establish exact facts such as:
86
155
 
87
- Read [execution and evidence](references/execution-and-evidence.md) when operating commands, resolving paths, interpreting states, or reasoning about Pi isolation, persistence, views, cancellation, cleanup, and safeguards.
156
+ - skill or resource reads;
157
+ - file and path state;
158
+ - changed paths;
159
+ - file or response text;
160
+ - JSON validity or values;
161
+ - tool-call outcomes and argument predicates;
162
+ - context text at a selected surface, request, and turn;
163
+ - factual baseline-to-candidate transitions.
88
164
 
89
- ## Grade And Inspect Facts
165
+ A failed check remains ordinary behavioral evidence. It does not turn a valid subject run into infrastructure failure.
90
166
 
91
- Append deterministic grades only after canonical run evidence exists. A grade is derived evidence and never mutates or invalidates a run.
167
+ Missing evidence remains unavailable.
92
168
 
93
- Supported checks cover exact skill/resource reads, typed paths, changed paths, file/response text, explicit JSON states, tool-call outcomes and argument predicates, system-prompt or provider-context text by selected request and turn, valid turn scope, and factual baseline-to-candidate transitions. A failed check remains ordinary behavioral evidence. Missing evidence stays unavailable. Malformed checks or grading failures produce separate `grade-error` evidence. Transitions carry no quality or readiness meaning.
169
+ Malformed expectations or grading failures produce separate `grade-error` evidence and do not rewrite canonical run evidence.
94
170
 
95
- Prefer generated grade-first views for routine inspection. Use ordinary file tools for raw run, event, transcript, response, stderr, workspace, definition, grade, context-observation, and group artifacts. A view may remove repeated transport structure; it must not hide evidence required by the question.
171
+ A transition such as `fail-to-pass` is a factual comparison. It does not mean bad-to-good, not-ready-to-ready, or rejected-to-promotable.
96
172
 
97
- Read [review and revision](references/review-and-revision.md) after evidence exists, when surfaces conflict, meaning still needs judgment, or a revision/rerun boundary must be chosen.
173
+ ## Review Meaning After Evidence Exists
174
+
175
+ After canonical evidence and deterministic grades exist, read [Review and Revision](references/review-and-revision.md) when:
176
+
177
+ - evidence conflicts;
178
+ - semantic meaning remains unresolved;
179
+ - the failed boundary must be classified;
180
+ - a revision target must be selected;
181
+ - rerun scope is uncertain.
182
+
183
+ The evaluator does not launch an automatic semantic grader.
184
+
185
+ The active agent or user may judge reasoning quality, authority preservation, architectural fitness, recommendation quality, or semantic completeness. Keep that judgment, cited evidence, uncertainty, and limits outside canonical run and grade state.
186
+
187
+ ## Return Revision To The Author
188
+
189
+ When evidence supports a candidate change:
190
+
191
+ 1. identify the exact failed boundary;
192
+ 2. preserve the canonical result path and relevant evidence;
193
+ 3. state one measured revision target;
194
+ 4. keep unrelated instructions and criteria stable;
195
+ 5. return revision to Write Skill;
196
+ 6. rerun the complete fixed group with both variants after the change.
197
+
198
+ Do not edit the skill from Evaluate Skill.
199
+
200
+ If the evaluation definition or criterion is wrong, preserve the old result and state that it no longer answers the revised question. Do not reinterpret it as evidence for the new question.
98
201
 
99
202
  ## Report And Stop
100
203
 
101
- Report what ran, exact variant identities, deterministic results, infrastructure failures, unavailable evidence, viewed scope, and canonical result paths. State what the evidence proves and does not prove.
204
+ Report:
205
+
206
+ - what ran;
207
+ - exact baseline and candidate identities;
208
+ - selected groups and variants;
209
+ - deterministic results;
210
+ - infrastructure failures, cancellation, or unavailable evidence;
211
+ - viewed scope;
212
+ - canonical result paths;
213
+ - what the evidence proves;
214
+ - what it does not prove;
215
+ - any supported failed boundary or revision target.
102
216
 
103
- Stop rather than overclaim when required activation, first-read, composition, isolation, multi-turn, artifact, or host evidence is unavailable. The active agent or user judges unresolved behavior. The user decides whether to revise, use, publish, or reject a skill.
217
+ Stop rather than overclaim when required activation, first-read, composition, retained-use, isolation, artifact, or host evidence is unavailable.
104
218
 
105
- Never invoke archived evaluators.
219
+ The active agent or user judges unresolved behavior. The user decides whether to revise, use, publish, or reject the skill.
@@ -58,7 +58,7 @@ Rules:
58
58
  - `schema_version` is `1`.
59
59
  - `kind` is `group`.
60
60
  - `id` starts with a lowercase letter, contains lowercase letters, numbers, or single hyphens, and is at most 64 characters.
61
- - `type` is `description`, `body`, or reserved `end-to-end`. The current runner rejects `end-to-end` before subject execution.
61
+ - `type` is `description` or `body`.
62
62
  - `input` contains exactly one of:
63
63
  - `prompt`: one non-empty string;
64
64
  - `turns`: a non-empty ordered array of non-empty strings. Repeated natural turns are allowed.
@@ -252,7 +252,7 @@ Each environment has exactly:
252
252
  "source": { "kind": "git", "ref": "v1.2.3" },
253
253
  "skills": ["skills/target", "skills/support"],
254
254
  "target": 0,
255
- "context": ["runtime/prompts/interaction-contract.md"]
255
+ "context": ["context/base-guidance.md"]
256
256
  }
257
257
  ```
258
258
 
@@ -1,6 +1,6 @@
1
1
  # Evaluation Design
2
2
 
3
- Read this when choosing the behavioral question, evidence class, group shape, or baseline/candidate boundary.
3
+ Read this before choosing or materially changing the behavioral question, evidence class, group shape, pressure, or baseline/candidate boundary.
4
4
 
5
5
  ## Keep Roles Distinct
6
6
 
@@ -8,10 +8,10 @@ Read this when choosing the behavioral question, evidence class, group shape, or
8
8
  - **Evaluator:** isolates subjects and preserves canonical evidence.
9
9
  - **Deterministic grader:** derives fixed mechanical facts after run persistence.
10
10
  - **Reviewer:** the active agent or user judges unresolved meaning.
11
- - **Author:** revises one measured pressure point.
11
+ - **Author:** uses Write Skill to revise one measured pressure point.
12
12
  - **User:** decides whether to revise, use, publish, or reject the skill.
13
13
 
14
- The evaluator does not launch an automatic semantic grader or own readiness, promotion, or production status.
14
+ The evaluator does not revise the skill, launch an automatic semantic grader, or own readiness, promotion, or production status.
15
15
 
16
16
  ## Map Claims To Evidence
17
17
 
@@ -23,64 +23,90 @@ The evaluator does not launch an automatic semantic grader or own readiness, pro
23
23
  | Declared dependencies compose | Exact ordered composition |
24
24
  | Guidance remains useful later | Multi-turn evidence |
25
25
  | Files or structured state match | Artifact outcome |
26
- | Behavior holds on several hosts | The same group semantics on every named host |
26
+ | Behavior holds across named hosts | The same group semantics on every named host |
27
27
 
28
- Record declaration, materialization, delivery, observed reads, behavior, artifacts, and derived grades separately. A read does not prove compliance, and correct behavior does not prove which skill caused it.
28
+ Record separately:
29
+
30
+ - declaration;
31
+ - resource materialization;
32
+ - delivery;
33
+ - observed reads;
34
+ - behavior;
35
+ - artifacts;
36
+ - derived grades;
37
+ - later semantic judgment.
38
+
39
+ A read does not prove compliance. Correct behavior does not prove which skill caused it.
29
40
 
30
41
  ## Choose The Smallest Group Shape
31
42
 
32
43
  - **Description prompt:** natural activation and exact read timing.
33
- - **Explicit body task:** first-read instructions and behavior without activation ambiguity.
44
+ - **Explicit body task:** first-read body behavior without activation ambiguity.
34
45
  - **Fixture task:** files or repository state matter.
35
- - **Stateful turns:** ordered conversation and later behavior matter.
36
- - **Saved-result review:** stored runs already answer the question; inspect them instead of rerunning.
37
- - **Suite:** independent questions need one ordered serial invocation.
46
+ - **Stateful turns:** ordered conversation and retained use matter.
47
+ - **Saved-result review:** canonical evidence already answers the question.
48
+ - **Suite:** several independent questions require one ordered serial invocation.
49
+
50
+ Keep activation and body behavior separate unless their integrated interaction is the exact question and the current runner supports that observing boundary.
51
+
52
+ ## Fix Exact Variants
53
+
54
+ Every group contains exactly:
38
55
 
39
- Keep description and body questions separate unless the integrated path is itself the question.
56
+ - `baseline`;
57
+ - `candidate`.
40
58
 
41
- ## Fix The Variants
59
+ For a new skill, baseline has no target.
42
60
 
43
- Every group has exactly:
61
+ For a revision, baseline names an exact immutable previous package. If no exact baseline exists, return to Write Skill before revision.
44
62
 
45
- - `baseline`: no target for a new skill, or the exact previous snapshot for a revision;
46
- - `candidate`: the new or updated snapshot.
63
+ For a description-only revision, body and resources remain byte-identical.
47
64
 
48
- For a description-only revision, keep body and resources byte-identical. Freeze prompts or turns, fixture, tools, model, thinking, other skills, context, and criteria across variants.
65
+ Freeze prompts or turns, fixture, tools, model, thinking, other skills, context, runtime, and criteria across variants.
49
66
 
50
67
  ## Design Common Questions
51
68
 
52
- ### Description routing
69
+ ### Description activation
53
70
 
54
- Use the earliest natural prompt where the skill should become useful. For a nearby prompt, predeclare whether success means non-trigger or safe behavior after activation.
71
+ Use the earliest natural prompt where the target should become useful.
72
+
73
+ For a nearby prompt, predeclare whether success means:
74
+
75
+ - non-trigger; or
76
+ - safe behavior after activation.
55
77
 
56
78
  ### First-read body
57
79
 
58
- Explicitly deliver the exact body with only guaranteed context. Ambient package context cannot repair a missing dependency.
80
+ Explicitly deliver the exact target body with only guaranteed context. Ambient package context cannot repair a hidden dependency.
59
81
 
60
- ### Composition
82
+ ### Dependency composition
61
83
 
62
- Materialize exact ordered skills and context. Vary only the target snapshot. Standalone behavior should not receive a hidden base stack.
84
+ Materialize exact ordered skills and context. Vary only the target snapshot. Do not provide a hidden base stack.
63
85
 
64
86
  ### Retained use
65
87
 
66
- Use declared turns in one persistent subject process. Repeated explicit delivery does not prove retained use.
88
+ Use ordered turns in one persistent subject process. Repeated body delivery does not prove retained use.
67
89
 
68
90
  ### Artifact outcome
69
91
 
70
- Grade filesystem state, changed paths, file content, or JSON before relying on the final response. Preserve turn-scoped workspace evidence when later turns may change earlier state.
92
+ Grade files, changed paths, structured state, and events before relying on the final response. Preserve turn-scoped workspace evidence when later turns may change earlier state.
71
93
 
72
- ## Boundary Examples
94
+ ## Apply Real Pressure
73
95
 
74
- Saved complete evidence already contains the required run, grade, and artifacts:
96
+ A useful group:
75
97
 
76
- > Use `view` and ordinary file reads. Do not rerun merely to demonstrate the process.
98
+ - creates a natural temptation to violate the intended behavior;
99
+ - keeps criteria and review questions outside the prompt;
100
+ - exposes deterministic evidence where possible;
101
+ - distinguishes baseline from candidate behavior;
102
+ - remains realistic enough that passing behavior is useful.
77
103
 
78
- An explicitly delivered body produces the right answer, but the natural prompt never reads the target:
104
+ If both variants pass, the pressure may be weak or the baseline sufficient.
79
105
 
80
- > The body group supports first-read behavior. The description group still fails activation; body success cannot repair it.
106
+ If both fail, classify skill, fixture, dependency, environment, host, isolation, or criterion before editing.
81
107
 
82
- ## Apply Real Pressure
108
+ ## Reuse Existing Evidence
83
109
 
84
- A useful group creates a real temptation to violate the rule, keeps criteria outside the prompt, exposes deterministic evidence where possible, and distinguishes baseline behavior from the candidate.
110
+ When saved canonical evidence already answers the fixed question, inspect it through views and raw artifacts. Do not rerun merely to demonstrate process.
85
111
 
86
- If both variants pass, the pressure may be weak or the baseline sufficient. If both fail, classify the skill, fixture, host, dependency, or criterion before editing.
112
+ An explicitly delivered body may support first-read behavior while a natural prompt still fails activation. Preserve both conclusions; one does not repair the other.
@@ -33,7 +33,7 @@ With no selectors, `run` or `view` selects every suite group and both variants.
33
33
 
34
34
  ## Current Execution Boundary
35
35
 
36
- `run` executes description and body groups. `end-to-end` is a reserved definition type and is rejected before subject execution. Description groups allow no tools or `read`; body groups allow no tools or path-guarded `read`, `write`, and `edit`, plus non-native custom tools supplied by a declared runtime extension bundle. Native `bash`, `powershell`, `grep`, `find`, and `ls` tools and definition-supplied commands are unsupported.
36
+ `run` executes description and body groups. Unsupported group types are rejected before subject execution. Description groups allow no tools or `read`; body groups allow no tools or path-guarded `read`, `write`, and `edit`, plus non-native custom tools supplied by a declared runtime extension bundle. Native `bash`, `powershell`, `grep`, `find`, and `ls` tools and definition-supplied commands are unsupported.
37
37
 
38
38
  A runtime profile selects the installed `pi` or `piflow` host, whether the variant uses an isolated persistent session directory, zero or more ordered extension bundles, and declarative environment sources. Literal values are non-secret configuration; only explicitly inherited parent variables are passed to the child without being persisted, alongside a small host-runtime baseline. Missing inherited variables invalidate the variant. Launch-control and loader keys are rejected from inherited values, and literal and inherited names must not overlap. For body runs, delivery remains `unavailable` until target setup succeeds; `natural-prompt` or `explicit-skill-command` records a prompt attempt. When a group declares context assertions, the evaluator launches the base guard first, declared extensions second, and a final non-mutating observer last. The observer records both the effective `before_agent_start` system prompt and each provider-neutral `context` message projection; it does not replace or sanitize extension injections after the base guard has established evaluator-owned isolation.
39
39
 
@@ -1,51 +1,92 @@
1
1
  # Review And Revision
2
2
 
3
- Read this after canonical evidence and deterministic grades exist, when evidence conflicts, meaning still needs judgment, or a revision/rerun boundary must be chosen.
3
+ Read this after canonical evidence and deterministic grades exist, when evidence conflicts, meaning remains unresolved, the failed boundary must be classified, or revision and rerun scope must be chosen.
4
4
 
5
5
  ## Use The Strongest Evidence
6
6
 
7
- 1. Filesystem state, typed workspace manifests, diffs, and changed paths.
8
- 2. Structured events, tool activity, usage, process results, logs, and saved reports.
9
- 3. Final response.
10
- 4. Full transcript when earlier surfaces cannot answer the question.
11
- 5. Subject self-assessment.
7
+ Prefer, in order:
12
8
 
13
- Lower-priority evidence cannot repair a contradiction above it. If the response claims success but a required file is absent, preserve both facts and grade the file observation.
9
+ 1. filesystem state, typed workspace manifests, diffs, and changed paths;
10
+ 2. structured events, tool activity, usage, process results, logs, and saved reports;
11
+ 3. final response;
12
+ 4. full transcript when stronger surfaces cannot answer the question;
13
+ 5. subject self-assessment.
14
+
15
+ Lower-priority evidence cannot repair a contradiction above it.
16
+
17
+ If a response claims success but a required file is absent, preserve both facts and judge from the stronger artifact evidence.
14
18
 
15
19
  ## Keep Deterministic Facts Separate
16
20
 
17
- Built-in checks cover exact reads, typed paths, changed paths, file or response text, JSON states, valid turn scope, and factual transitions. Missing evidence remains unavailable. A failed check remains behavioral evidence; it does not relabel a complete run as infrastructure failure.
21
+ Built-in checks establish exact observable facts. Missing evidence remains unavailable. A failed check remains behavioral evidence and does not relabel a complete run as infrastructure failure.
22
+
23
+ The active agent or user may judge:
18
24
 
19
- The active agent or user may judge reasoning quality, authority preservation, architectural fitness, recommendation quality, or semantic completeness. Record cited evidence, uncertainty, and limits outside the canonical run and deterministic grade. Do not turn that judgment into evaluator-owned readiness state.
25
+ - reasoning quality;
26
+ - authority preservation;
27
+ - architectural fitness;
28
+ - recommendation quality;
29
+ - semantic completeness.
20
30
 
21
- ## Diagnose Before Editing
31
+ Keep semantic judgment, cited evidence, uncertainty, and limits outside canonical run and deterministic grade state.
22
32
 
23
- Classify the failed boundary:
33
+ Do not turn semantic judgment into evaluator-owned readiness or promotion status.
34
+
35
+ ## Diagnose The Failed Boundary
36
+
37
+ Classify before revising:
24
38
 
25
39
  - activation timing;
26
40
  - description language unavailable before body read;
27
41
  - first-read body comprehension;
28
42
  - undeclared, undelivered, unread, or ambient-only dependency;
29
- - normal guidance hidden behind an unclear resource boundary;
43
+ - normal guidance hidden behind the wrong resource boundary;
30
44
  - nearby behavior that hijacks the task;
31
45
  - retained-use or multi-turn failure;
32
- - wording, placement, example, or stop-condition pressure;
33
- - fixture, environment, isolation, host, or deterministic-check failure.
46
+ - wording, placement, example, repetition, or stop-condition pressure;
47
+ - fixture, environment, isolation, host, runner, or deterministic-check failure.
48
+
49
+ Do not add broad prose before identifying which boundary failed.
34
50
 
35
- Do not add broad prose before identifying the failed boundary.
51
+ ## Return Revision To Write Skill
36
52
 
37
- ## Revise One Pressure Point
53
+ When evidence supports a skill change:
38
54
 
39
- Change one measured point when possible: description cues, first-read wording, rule placement, dependency declaration, resource boundary, example, stop condition, or the group when evidence proves the evaluation is wrong.
55
+ 1. name the exact failed boundary;
56
+ 2. cite the canonical evidence;
57
+ 3. identify one measured pressure point;
58
+ 4. preserve unrelated instructions and fixed criteria;
59
+ 5. return the revision target to [Write Skill](../../write-skill/SKILL.md).
40
60
 
41
- Keep unrelated instructions and fixed criteria stable. If the criterion changes, the old result no longer answers the same question.
61
+ Write Skill owns package revision.
62
+
63
+ Evaluate Skill does not edit the skill or replace its baseline while evaluating it.
64
+
65
+ When evidence proves the group, fixture, or criterion is wrong, revise the evaluation instead. Preserve the old result and state that it no longer answers the revised question.
42
66
 
43
67
  ## Rerun The Complete Group
44
68
 
45
- After a measured skill change or resolved infrastructure cause, run the complete fixed group with both variants. Do not rerun only the preferred variant, reuse a settled control as a new sample, adopt partial evidence as comparable, or rerun merely to erase a failure.
69
+ After a measured skill revision or resolved infrastructure cause:
70
+
71
+ - rerun the complete fixed group;
72
+ - run both baseline and candidate;
73
+ - keep every result visible;
74
+ - do not reuse an earlier baseline run as a fresh counterpart;
75
+ - do not rerun only the preferred variant;
76
+ - do not use partial evidence as a comparable full result;
77
+ - do not rerun merely to erase failure.
46
78
 
47
- For variance, use independent complete invocations and keep every result visible.
79
+ For variance, use independent complete invocations rather than repeated preferred variants.
48
80
 
49
81
  ## Report
50
82
 
51
- Report the failed boundary and evidence, exact revision or evaluation correction, criteria that stayed fixed, old and new result paths, and remaining unsupported claims. The user decides the next authoring or use action.
83
+ Report:
84
+
85
+ - failed boundary and evidence;
86
+ - exact skill revision or evaluation correction;
87
+ - criteria that remained fixed;
88
+ - old and new result paths;
89
+ - deterministic transitions;
90
+ - remaining unsupported claims.
91
+
92
+ The user decides whether to revise further, use, publish, or reject the skill.