@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
@@ -1,128 +1,171 @@
1
1
  ---
2
2
  name: review-work
3
- description: Use when reviewing implementation or integrated work, whether reviewing work you produced or acting as an independent reviewer.
3
+ description: Use when judging implementation or integrated work through self-review or independent review, or when adjudicating a returned independent review report.
4
4
  ---
5
5
 
6
6
  # Review Work
7
7
 
8
- Judge whether work is correct, suitable, and sufficiently evidenced for its intended boundary.
8
+ Judge whether implementation or integrated work is correct, suitable, and sufficiently evidenced for a named boundary.
9
9
 
10
- Review provides judgment. [Verify Work](../verify-work/SKILL.md) establishes what direct evidence proves. Review may challenge whether that evidence is sufficient, but it does not replace verification or authorize changes.
10
+ Review provides judgment. [Verify Work](../../skills/verify-work/SKILL.md) establishes what direct evidence proves. Review may find that evidence insufficient, but it does not replace verification or authorize changes.
11
11
 
12
- ## Choose The Review Role
12
+ ## Select One Route
13
13
 
14
- Choose the role before reviewing:
14
+ Choose the route before reviewing:
15
15
 
16
- - **Self-review:** you produced the work. Inspect it silently using the relevant boundary and lenses below. Correct clear local issues within existing authority and re-verify. Create no formal review items, judgment, number, or cycle. Return unresolved material issues to [Workflow](../workflow/SKILL.md).
17
- - **Independent review:** you did not produce the reviewed state. Inspect and report without editing. Use the formal item, judgment, and report method below. The receiving active agent adjudicates and routes the result.
16
+ - **Self-review:** you produced the reviewed state.
17
+ - **Independent review:** you did not produce the reviewed state and are reviewing from a separate context.
18
+ - **Adjudication:** an independent reviewer returned a report and you are deciding what its findings establish and what follows.
18
19
 
19
- Reading this skill does not create independence. If you produced the work, do not present your own judgment as independent review. Before preparing or performing a separately selected independent review, read the [Independent Work Reviewer Contract](references/independent-work-reviewer-contract.md).
20
+ Self-review and independent review use the same review kernel below. Adjudication consumes a completed review; it is not another review.
21
+
22
+ Do not cross roles inside an independent reviewer context. The independent reviewer reports and stops. The receiving agent may then enter adjudication.
20
23
 
21
24
  ## Establish The Boundary
22
25
 
23
- Understand:
26
+ Identify only what the judgment needs:
24
27
 
25
- - the accepted outcome, requirements, and non-goals;
26
- - the implementation, diff, or integrated work product;
28
+ - the future action or boundary the review protects;
29
+ - the exact implementation, diff, commit, or integrated state;
30
+ - accepted outcome, requirements, and non-goals;
27
31
  - relevant Specs, Plans, tests, policies, ADRs, and established behavior;
28
32
  - verification evidence and known gaps;
29
- - risks and interactions material to the future action this review protects.
33
+ - risks and interactions capable of changing whether the boundary may be crossed.
34
+
35
+ Inspect the reviewed state and source truth directly. Do not judge only the producer's summary, reasoning, or claimed result.
30
36
 
31
- Inspect the work and source truth directly, not only the author's summary, reasoning, or claimed result. Before reviewing work that changes trust boundaries, authentication, authorization, permissions, untrusted input, secrets, sensitive data, security-relevant dependencies or external integrations, code-execution boundaries, or failure behavior with security consequences, read the [Security Risk Lens](references/security-risk-lens.md).
37
+ Before reviewing changes to trust boundaries, authentication, authorization, permissions, untrusted input, secrets, sensitive data, security-relevant dependencies, code execution, or security-sensitive failure behavior, read the [Security Risk Lens](references/security-risk-lens.md).
32
38
 
33
- Review Work owns the review boundary, lenses, and judgment. When source inspection branches among several plausible observers or is likely to be broad, use [Action Selection](../action-selection/SKILL.md) to choose and bound one environment interaction. It returns evidence to the same review role. Skip it for an obvious diff, file, or source-truth read.
39
+ When inspection could branch broadly among several useful observers, use [Action Selection](../../skills/action-selection/SKILL.md). Skip it for an obvious diff, file, test, or source-truth read.
34
40
 
35
- ## Review Proportionately
41
+ ## Apply The Shared Review Kernel
36
42
 
37
- Apply only lenses that can materially change the result:
43
+ Use only lenses capable of changing the boundary judgment:
38
44
 
39
45
  - **Alignment and correctness:** accepted behavior is implemented without invention or omission.
40
46
  - **Regression and integration:** affected callers, states, and components remain correct together.
41
- - **Failure and risk:** relevant errors, recovery, permissions, data, and compatibility behave safely.
42
- - **Evidence:** verification supports the claims and exercised the required boundary.
47
+ - **Failure and risk:** material errors, recovery, permissions, data, and compatibility behave safely.
48
+ - **Evidence:** verification supports the claims at the required observing boundary.
43
49
  - **Design and minimality:** complexity and coordination are justified by requirements or observed failures.
44
- - **Maintainability:** the work can be understood and changed without hidden policy or fragile coupling.
50
+ - **Maintainability:** behavior remains understandable and changeable without hidden policy or fragile coupling.
45
51
 
46
- A pass is valid. Do not invent items, report preferences or hypothetical completeness, reopen intentional deferrals, or treat ordinary reversible choices as issues.
52
+ Review the resulting state, not the producer's intention. Use a high evidence bar, not a high item count. Finding no material issue is valid.
47
53
 
48
- A possible edge case is not an Issue merely because it can be imagined:
54
+ ### Classify Before Calling Something An Issue
49
55
 
50
- ```text
51
- Required failure path is missing -> Issue
52
- Unsettled expected behavior -> Question
53
- Plausible concern without reachability or consequence evidence -> Needs evidence
54
- Useful resilience outside this boundary -> Improvement or omit
55
- Repeated related corrections -> diagnose the shared cause
56
- ```
56
+ Ask in order:
57
57
 
58
- ## Classify Independent Review Items
58
+ 1. **Is the required behavior or source truth settled?**
59
+ - No: **Question**.
60
+ 2. **Are reachability and material consequence supported?**
61
+ - No: **Needs evidence**.
62
+ 3. **Does the reviewed boundary require correction?**
63
+ - Yes, and the boundary cannot be crossed safely: **Blocking Issue**.
64
+ - Yes, but correction can be deferred safely: **Non-blocking Issue**.
65
+ 4. **Would the change merely be useful beyond this boundary?**
66
+ - Omit it by default.
67
+ - Use **Improvement** only when materially relevant or explicitly requested.
59
68
 
60
- - **Blocking Issue:** a supported defect, regression, omission, or risk that must be resolved before crossing the reviewed boundary.
61
- - **Non-blocking Issue:** a real issue that can be deferred safely for this boundary.
62
- - **Question:** material intent, requirements, or an owner decision is unclear.
63
- - **Needs evidence:** a plausible concern cannot be established from available evidence.
64
- - **Improvement:** a materially useful enhancement not required by this boundary. It does not affect judgment or authorize implementation.
69
+ A material **Needs evidence** observation must name the claim, required observing boundary, available evidence and its limit, why the gap affects judgment, and the smallest evidence that could disagree.
65
70
 
66
- A Blocking Issue must name the exact location, violated requirement or source truth, evidence, concrete boundary consequence, and smallest safe correction or owning activity to re-enter.
71
+ Do not turn preferences, imagined edge cases, intentional deferrals, or hypothetical completeness into Issues.
67
72
 
68
- Use the most consequential applicable judgment:
73
+ An Issue must identify:
69
74
 
70
- 1. **Blocking:** one or more Blocking Issues exist.
71
- 2. **Inconclusive:** no Blocking Issue exists, but a material Question or Needs evidence item prevents judgment.
72
- 3. **Non-blocking:** only Non-blocking Issues remain.
73
- 4. **Pass:** no Issues or material Unresolved items remain. Improvements may still be reported.
75
+ - the exact location or affected path;
76
+ - the violated requirement, source truth, or invariant;
77
+ - supporting evidence;
78
+ - the concrete consequence for the reviewed boundary.
74
79
 
75
- Pass, Non-blocking, Inconclusive, and Blocking are all valid review exits. A review ends with its report; it does not remain active until the work passes.
80
+ For a Blocking Issue, state why the boundary cannot safely be crossed. Describe correction constraints or the owning activity to re-enter. Recommend a specific correction only when it is directly supported rather than one of several material alternatives.
76
81
 
77
- ## Adjudicate Independent Review And Route
82
+ ## Self-Review
78
83
 
79
- After independent review, the receiving active agent adjudicates each material item against the work, source truth, and evidence rather than forwarding the report:
84
+ Apply the complete shared kernel to your own work. Self-review uses the same technical scrutiny as independent review but does not create independence.
80
85
 
81
- - **Accepted:** supported and applicable. State the actual implementation problem, boundary consequence, and whether its cause is supported, unnecessary to select a bounded correction, or uncertain.
82
- - **Rejected:** unsupported, stale, resolved, duplicate, preference-only, out of scope, or based on a source misread. State why.
83
- - **Open:** a question or evidence gap prevents acceptance or rejection. State the concern, potential consequence, and missing evidence or decision.
86
+ When evidence supports a clear local defect and existing authority covers its correction:
84
87
 
85
- A reviewer's suggested correction may bound an item, but it does not establish the cause or select the remedy. Confirm whether each accepted Issue is Blocking or Non-blocking, derive the adjudicated judgment, and do not accept the reviewer's overall judgment separately.
88
+ 1. return to the producing activity;
89
+ 2. correct the defect;
90
+ 3. re-verify the affected boundary;
91
+ 4. repeat only the affected review lenses once.
86
92
 
87
- - **Pass:** proceed.
88
- - **Non-blocking:** proceed with explicit deferrals.
89
- - **Inconclusive:** gather the missing evidence or decision.
90
- - **Blocking:** do not cross the boundary; re-enter the narrowest owning activity, defer, or stop.
93
+ Do not create formal review items, a judgment, a review number, or a review cycle for self-review. Do not label it independent.
91
94
 
92
- ### Decide Whether Independent-Review Remediation Is Ready
95
+ Return unresolved material issues to [Workflow](../../skills/workflow/SKILL.md). Use [Diagnose Failure](../../skills/diagnose-failure/SKILL.md) when the cause is unclear or correction repeats. Use [Decision Gate](../../skills/decision-gate/SKILL.md) when accepted behavior or a user-owned choice is unsettled.
93
96
 
94
- Remediation is ready when accepted behavior, the problem and consequence, and enough causal or decision basis support a bounded correction. When the finding is clear, the correction local, verification direct, and no material alternative or user choice remains, include adjudication and remediation in the same assistant response.
97
+ ## Independent Review
95
98
 
96
- Use the current response for a separate problem checkpoint when findings interact, the cause matters but remains unsupported, accepted assumptions or design are challenged, materially different corrections remain, or user input could change the approach:
99
+ Before preparing or performing a separately selected independent review, read the [Independent Work Reviewer Contract](references/independent-work-reviewer-contract.md).
97
100
 
98
- 1. Report the adjudication, problem and consequence, cause status, settled constraints, and controlling question or evidence.
99
- 2. Name [Discuss](../discuss/SKILL.md), [Diagnose Failure](../diagnose-failure/SKILL.md), [Decision Gate](../decision-gate/SKILL.md), evidence gathering, or another affected owner as the next route, then stop and wait.
101
+ Use supplied and already available evidence. Do not start a missing active check unless the review authority explicitly covers that exact check. Otherwise report **Needs evidence** with the claim and required observing boundary. When an exact check is covered, apply Verify Work's check-result and claim-result semantics; the review still owns the fitness judgment.
102
+
103
+ Inspect and report without editing. Do not:
104
+
105
+ - adjudicate your own findings;
106
+ - select among materially different remedies;
107
+ - perform corrections;
108
+ - dispatch another review;
109
+ - continue merely to obtain Pass.
110
+
111
+ The independent review ends with its report.
112
+
113
+ Independent judgments are:
114
+
115
+ 1. **Blocking:** at least one Blocking Issue exists.
116
+ 2. **Inconclusive:** no Blocking Issue exists, but a material Question or Needs evidence item prevents judgment.
117
+ 3. **Non-blocking:** only Non-blocking Issues remain.
118
+ 4. **Pass:** no Issues or material unresolved items remain.
119
+
120
+ Improvements do not change the judgment or authorize implementation.
121
+
122
+ ## Adjudicate A Returned Review
123
+
124
+ Before adjudicating an independent report, read [Adjudicate Work Review](references/adjudicate-work-review.md).
125
+
126
+ Assess every material item against the reviewed state, source truth, and available evidence:
127
+
128
+ - **Accepted:** supported and applicable.
129
+ - **Rejected:** unsupported, stale, resolved, duplicate, preference-only, out of scope, or based on a source misread.
130
+ - **Open:** missing evidence or a decision prevents acceptance or rejection.
131
+
132
+ Do not separately accept the reviewer's overall judgment. Derive the adjudicated judgment from the dispositions.
133
+
134
+ Findings are evidence, not commands or correction authority.
135
+
136
+ - **Pass:** proceed.
137
+ - **Non-blocking:** proceed with explicit deferrals.
138
+ - **Inconclusive:** obtain the missing evidence or decision.
139
+ - **Blocking:** do not cross the boundary; select the narrowest owning route.
100
140
 
101
- Continue remedy selection only when a later user turn or new evidence supplies enough support. Do not request implementation authority before selecting a remedy or wait for the user to elicit the missing analysis. The checkpoint is not another review and creates no correction or dispatch authority.
141
+ When remediation is ready, state the supported problem, correction, rationale, verification boundary, authority state, and whether focused follow-up review remains justified. Actual correction returns to [Execute Work](../../skills/execute-work/SKILL.md).
102
142
 
103
- A remediation-ready route states the proposed correction and rationale, verification boundary, whether focused follow-up is needed, and authority status. Findings are evidence, not commands, and do not authorize edits. Accepted corrections return to [Execute Work](../execute-work/SKILL.md) and may remain in the same [Track Work](../track-work/SKILL.md) slice while its intended result stays coherent.
143
+ ## Limit Independent Review
104
144
 
105
- Use existing correction authority when it covers the result. Otherwise ask once for the correction and any warranted focused follow-up; omit follow-up when direct evidence can settle the changed boundary. Then wait; do not correct or dispatch a follow-up from the request itself. Verify authorized corrections and run follow-up only when the changed boundary still needs independent judgment and that dispatch is authorized. Do not change tests, Specs, policies, or accepted behavior merely to satisfy a reviewer or obtain Pass.
145
+ Treat review count as a budget, not a schedule.
106
146
 
107
- ## Limit The Review Cycle
147
+ - **Review 1:** the first selected independent review; broad by default.
148
+ - **Review 2:** a separately selected focused follow-up when accepted corrections, new evidence, affected interactions, or remaining risk still require independent judgment.
149
+ - **Review 3:** exceptional, separately authorized, and final. Use it only after the cause and correction boundary are understood.
108
150
 
109
- For one independently reviewed work state and boundary:
151
+ A review report always ends its review. Remediation does not automatically authorize or require follow-up review.
110
152
 
111
- 1. Review 1 is the normal broad review.
112
- 2. Review 2, when needed and authorized, focuses on accepted corrections, affected interactions, and remaining risk.
113
- 3. Review 3 is exceptional, separately authorized, and final.
153
+ If Review 2 remains Blocking:
114
154
 
115
- The budget is a cap, not dispatch authority. Do not request Review 4; return control to Workflow at the cap.
155
+ - diagnose when the blocker repeats, extends, invalidates, or exposes another consequence of prior correction, or when its cause remains uncertain;
156
+ - return an independent clear local defect to its owner when diagnosis would add no useful understanding;
157
+ - do not automatically correct and dispatch Review 3.
116
158
 
117
- After Review 2 is adjudicated Blocking, stop before another correction or Review 3:
159
+ Do not request Review 4. A different reviewer, local correction, or renamed scope does not reset the budget. Workflow may establish a new cycle only for a materially new reviewed state and boundary.
118
160
 
119
- - If the blocker repeats, extends, invalidates, or exposes another consequence of the prior correction, or its cause remains unsupported, read [Diagnose Failure](../diagnose-failure/SKILL.md) and diagnose the shared cause first.
120
- - If it is an independent clear local defect with a supported cause, return to its owner and state why diagnosis is unnecessary.
161
+ Self-review does not consume this budget.
121
162
 
122
- Diagnosis follows adjudicated evidence, not reviewer judgment alone. Review 3 is final judgment after the cause and correction boundary are understood, not another attempt to discover them through patches. Workflow may establish a new cycle only for a materially new reviewed state and boundary; local fixes, a different reviewer, or renamed scope do not reset it.
163
+ ## Stop
123
164
 
124
- ## Report
165
+ Stop when the selected route has produced its bounded result:
125
166
 
126
- For self-review, report no formal result. Correct clear local issues and surface only unresolved material issues that change the route.
167
+ - self-review: the supported state is accepted or a material issue is routed;
168
+ - independent review: the report is complete;
169
+ - adjudication: material items are disposed and the next route is explicit.
127
170
 
128
- For independent review, use the [Independent Work Reviewer Contract](references/independent-work-reviewer-contract.md) and stop with its report. The receiving agent then reports the reviewer and adjudicated judgments, each material item's outcome and reason, and either the problem checkpoint or remediation-ready route defined above. Omit empty groups and support the result with source or evidence rather than confidence.
171
+ Do not review until Pass, use review to authorize correction, or turn optional improvement into unfinished work.
@@ -0,0 +1,97 @@
1
+ # Adjudicate Work Review
2
+
3
+ Read this after an independent work review returns and before selecting what follows from its report.
4
+
5
+ Adjudication belongs to the receiving active agent. It tests the report against the reviewed state, source truth, and evidence. It is not independent review and does not inherit the reviewer's authority or judgment.
6
+
7
+ ## Dispose Each Material Item
8
+
9
+ For every material item, choose one disposition.
10
+
11
+ ### Accepted
12
+
13
+ State:
14
+
15
+ - the supported implementation problem;
16
+ - its consequence for the reviewed boundary;
17
+ - whether it is Blocking or Non-blocking;
18
+ - whether its cause is supported, unnecessary to select a clear local correction, or uncertain.
19
+
20
+ ### Rejected
21
+
22
+ State the concrete reason: unsupported, stale, resolved, duplicate, preference-only, out of scope, or based on a source misread.
23
+
24
+ ### Open
25
+
26
+ State:
27
+
28
+ - the unresolved concern;
29
+ - its potential boundary consequence;
30
+ - the missing evidence or owner decision.
31
+
32
+ When factual evidence is missing, restate the item as a Verify Work input: claim, required observing boundary, available evidence and its limit, and the smallest evidence that could disagree.
33
+
34
+ A suggested correction may help explain a finding, but it does not establish cause, select the remedy, or authorize implementation.
35
+
36
+ After disposing the items, derive the adjudicated judgment. Do not separately accept the reviewer's overall judgment.
37
+
38
+ - **Pass:** no accepted Issues or material Open items remain.
39
+ - **Non-blocking:** only accepted Non-blocking Issues remain.
40
+ - **Inconclusive:** a material Open item prevents judgment.
41
+ - **Blocking:** at least one accepted Blocking Issue remains.
42
+
43
+ ## Use Verification Results
44
+
45
+ Route a known material evidence gap through [Workflow](../../../skills/workflow/SKILL.md) to [Verify Work](../../../skills/verify-work/SKILL.md). Verification produces factual evidence; it does not revise the reviewer's report or determine the review judgment.
46
+
47
+ - **Supported:** re-adjudicate the evidence gap. Do not infer Pass.
48
+ - **Contradicted:** re-adjudicate against source truth; the result may establish an Issue, invalidate one, or expose a source conflict.
49
+ - **Inconclusive:** keep the item Open. The adjudicated review remains Inconclusive when the gap is material.
50
+ - **Unavailable:** keep the item Open and state why the required boundary cannot currently be observed.
51
+
52
+ Select focused independent follow-up only when the new evidence still requires judgment from a separate context.
53
+
54
+ ## Decide Whether Remediation Is Ready
55
+
56
+ Remediation is ready when:
57
+
58
+ - required behavior is settled;
59
+ - the problem and boundary consequence are supported;
60
+ - enough cause or decision basis exists to bound a correction;
61
+ - affected interactions and dependencies are known sufficiently;
62
+ - no material alternative or user-owned choice remains.
63
+
64
+ When remediation is ready, state:
65
+
66
+ - the proposed correction and rationale;
67
+ - affected behavior and locations;
68
+ - required ordering or constraints;
69
+ - regression evidence and verification boundary;
70
+ - whether focused independent follow-up remains justified;
71
+ - the authority state.
72
+
73
+ Use existing correction authority only when it covers that result. Otherwise propose the correction and any warranted follow-up once, then wait. A finding, adjudication, or selected review does not authorize mutation.
74
+
75
+ Actual correction returns to [Execute Work](../../../skills/execute-work/SKILL.md). Preserve the accepted behavior; do not change tests, Specs, policies, or source truth merely to satisfy a reviewer or obtain Pass.
76
+
77
+ ## Route When Remediation Is Not Ready
78
+
79
+ - unclear or repeated cause: [Diagnose Failure](../../../skills/diagnose-failure/SKILL.md);
80
+ - unsettled direction or materially different remedies: [Discuss](../../../skills/discuss/SKILL.md);
81
+ - user-owned choice or source conflict: [Decision Gate](../../../skills/decision-gate/SKILL.md);
82
+ - missing factual support: route the named claim through [Workflow](../../../skills/workflow/SKILL.md) to [Verify Work](../../../skills/verify-work/SKILL.md);
83
+ - uncovered correction: propose the bounded correction and wait.
84
+
85
+ When findings interact, assumptions are challenged, or user input could change the remedy, report a problem checkpoint and stop before selecting or executing a correction.
86
+
87
+ ## After Authorized Correction
88
+
89
+ Verify the affected boundary and perform ordinary self-review.
90
+
91
+ Select focused independent follow-up only when accepted corrections, affected interactions, new evidence, or remaining risk still require judgment from a separate context. Do not dispatch follow-up merely because Review 1 found an Issue or because remediation occurred.
92
+
93
+ If Review 2 remains Blocking, adjudicate it before acting again. Diagnose a repeated, extending, invalidating, or causally uncertain blocker. Return an independent clear local defect to its owner when diagnosis would add no useful understanding. Review 3 remains exceptional, separately authorized, and final.
94
+
95
+ ## Stop
96
+
97
+ Stop when every material item is Accepted, Rejected, or Open; the adjudicated judgment is supported; and the next route and authority state are explicit.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Read this before preparing or performing a separately selected independent review of implementation or integrated work.
4
4
 
5
- The reviewer did not produce the work. Give them the work product, source truth, and evidence needed to judge it directly. Do not provide only the author's summary, reasoning, or claimed result.
5
+ The reviewer did not produce the reviewed state. Give them the work product, source truth, and evidence needed to judge it directly. Do not provide only the producer's summary, reasoning, or claimed result.
6
6
 
7
7
  ## Required Context
8
8
 
@@ -10,11 +10,12 @@ Provide:
10
10
 
11
11
  - the work and future action covered by the review;
12
12
  - accepted outcome, requirements, and non-goals;
13
- - relevant specs, plans, tests, policies, ADRs, and established behavior;
13
+ - relevant Specs, Plans, tests, policies, ADRs, and established behavior;
14
14
  - the implementation, changed files, or diff range;
15
15
  - verification evidence and known gaps;
16
16
  - only the review lenses material to this boundary;
17
- - review number and, for a follow-up, prior items, adjudication, corrections, and new evidence.
17
+ - active evidence authority: none, or each exact covered check with its expected evidence and stop condition;
18
+ - review number and, for follow-up, prior items, adjudication, corrections, and new evidence.
18
19
 
19
20
  When state transitions or proof integrity matter, also provide the invariant or state owner, affecting paths, observing mechanism, forbidden mutations, prior-state requirements, adversarial disproof, mutation footprint, and fidelity limits.
20
21
 
@@ -23,13 +24,17 @@ When state transitions or proof integrity matter, also provide the invariant or
23
24
  ```md
24
25
  # Independent Work Review
25
26
 
26
- Review work you did not produce. Inspect the supplied work, source truth, and evidence directly. Report review items without editing. The review ends with this report; do not fix items, dispatch a follow-up, or keep reviewing merely to obtain Pass.
27
+ Review work you did not produce. Inspect the supplied work, source truth, and evidence directly. Report without editing. The review ends with this report; do not adjudicate findings, fix items, dispatch follow-up, or continue merely to obtain Pass.
27
28
 
28
- A pass is valid. Do not invent items, broaden scope, or treat possible improvement as unfinished work.
29
+ A pass is valid. Use a high evidence bar, not a high item count. Do not broaden scope or treat possible improvement as unfinished work.
30
+
31
+ Use supplied and already available evidence. Do not start a missing active check unless the review contract explicitly authorizes that exact check. Otherwise report **Needs evidence** with the claim and required observing boundary. When an exact check is covered, apply Verify Work's check-result and claim-result semantics; active evidence does not authorize editing or broaden the review.
29
32
 
30
33
  ## Boundary
31
34
 
32
- [Work and future action this review covers.]
35
+ - Protected future action: [boundary]
36
+ - Reviewed state: [commit, tree, diff, or other exact identity]
37
+ - Work: [diff range, changed files, implementation, or integrated result]
33
38
 
34
39
  ## Accepted Outcome And Non-Goals
35
40
 
@@ -39,12 +44,7 @@ A pass is valid. Do not invent items, broaden scope, or treat possible improveme
39
44
 
40
45
  ## Source Truth
41
46
 
42
- - [specs, plans, tests, policies, ADRs, and established behavior]
43
-
44
- ## Work Product
45
-
46
- - Reviewed state: [commit, tree, diff, or other identity]
47
- - Work: [diff range, changed files, implementation, or integrated result]
47
+ - [Specs, Plans, tests, policies, ADRs, and established behavior]
48
48
 
49
49
  ## Verification Evidence
50
50
 
@@ -56,8 +56,10 @@ A pass is valid. Do not invent items, broaden scope, or treat possible improveme
56
56
 
57
57
  - Review number: [1 | 2 | 3]
58
58
  - Material lenses: [alignment and correctness | regression and integration | failure and risk | evidence | design and minimality | maintainability]
59
+ - Active evidence authority: [none | exact covered check, expected evidence, and stop condition]
59
60
 
60
61
  For Review 2 or 3:
62
+
61
63
  - Prior items and adjudication: [Accepted | Rejected | Open]
62
64
  - Clarifications: [settled decisions or none]
63
65
  - Corrections and new evidence: [changes and verification]
@@ -67,41 +69,44 @@ For Review 2 or 3:
67
69
 
68
70
  Apply only the selected lenses:
69
71
 
70
- - The work satisfies accepted behavior without invention or omission.
71
- - Affected callers, states, and components remain correct together.
72
- - Relevant failure paths and material risks are handled safely.
73
- - Verification supports the claims and exercised the required boundary.
74
- - Complexity and coordination are justified by requirements or observed failures.
75
- - The work remains understandable and changeable without hidden policy or fragile coupling.
72
+ - accepted behavior is implemented without invention or omission;
73
+ - affected callers, states, and components remain correct together;
74
+ - material failure paths and risks are handled safely;
75
+ - verification supports the claims at the required boundary;
76
+ - complexity and coordination are justified;
77
+ - the work remains understandable without hidden policy or fragile coupling.
76
78
 
77
79
  Do not search for unrelated issues. Report an out-of-scope issue only when it materially affects whether this boundary may be crossed.
78
80
 
79
- A possible edge case is not an Issue without accepted behavior, observed reachability, or material risk. Use Question when expected behavior is unclear, Needs evidence when reachability or consequence is unsupported, and Improvement for useful resilience not required by the boundary.
81
+ Before calling something an Issue, ask:
80
82
 
81
- For Review 2 or 3, inspect only accepted corrections, affected interactions, new evidence, and remaining risk. Do not reopen Rejected items without contradictory evidence. For every new Blocking Issue, state whether it repeats, extends, invalidates, or exposes another consequence of a prior correction; is independent; or cannot yet be related from the evidence. Report a related pattern rather than proposing another patch. Review 3 is final for this cycle; do not recommend Review 4.
83
+ 1. Is required behavior or source truth settled? If not, use **Question**.
84
+ 2. Are reachability and material consequence supported? If not, use **Needs evidence**.
85
+ 3. Does the boundary require correction? Use **Blocking Issue** when it cannot be crossed safely, otherwise **Non-blocking Issue** when correction can be deferred safely.
86
+ 4. Is the change merely useful beyond this boundary? Omit it by default; use **Improvement** only when materially relevant or requested.
82
87
 
83
- ## Classify Review Items
88
+ A **Needs evidence** item must identify the claim, required observing boundary, available evidence and its limit, why the gap affects judgment, and the smallest evidence that could disagree.
84
89
 
85
- - **Blocking Issue:** supported defect or risk that must be resolved before crossing this boundary.
86
- - **Non-blocking Issue:** real issue that can be deferred safely for this boundary.
87
- - **Question:** material intent, requirement, or owner decision is unclear.
88
- - **Needs evidence:** a plausible concern cannot be established from available evidence.
89
- - **Improvement:** useful enhancement not required for this boundary. It does not affect judgment or authorize implementation.
90
+ A Blocking Issue must identify the exact location, violated requirement or source truth, evidence, concrete boundary consequence, and correction constraints or owning activity to re-enter. Recommend a specific correction only when directly supported.
90
91
 
91
- A Blocking Issue must include its exact location, violated requirement or source truth, evidence, concrete boundary consequence, and smallest safe correction or owning activity to re-enter.
92
+ For Review 2 or 3, inspect only accepted corrections, affected interactions, new evidence, and remaining risk. Do not reopen Rejected items without contradictory evidence. For each new Blocking Issue, state whether it repeats, extends, invalidates, or exposes another consequence of a prior correction; is independent; or cannot yet be related from the evidence. Report a related pattern rather than proposing another patch. Review 3 is final; do not recommend Review 4.
92
93
 
93
94
  ## Determine The Judgment
94
95
 
95
- 1. **Blocking:** one or more Blocking Issues exist.
96
+ 1. **Blocking:** at least one Blocking Issue exists.
96
97
  2. **Inconclusive:** no Blocking Issue exists, but a material Question or Needs evidence item prevents judgment.
97
98
  3. **Non-blocking:** only Non-blocking Issues remain.
98
- 4. **Pass:** no Issues or material Unresolved items remain. Improvements may still be reported.
99
+ 4. **Pass:** no Issues or material unresolved items remain.
100
+
101
+ Improvements do not change the judgment.
99
102
 
100
103
  ## Output
101
104
 
105
+ Omit empty groups. Do not include Improvements unless they are materially relevant or explicitly requested.
106
+
102
107
  Review type: independent
103
108
  Review number: [1 | 2 | 3]
104
- Boundary: [reviewed work and future action]
109
+ Boundary: [reviewed work and protected future action]
105
110
  Reviewed state: [state identity]
106
111
  Judgment: Pass | Non-blocking | Inconclusive | Blocking
107
112
  Reasoning: [concise evidence-backed judgment]
@@ -110,7 +115,7 @@ Relationship to prior items (Review 2 or 3 only): [related consequence | indepen
110
115
  ### Review Items
111
116
 
112
117
  #### Issues — Blocking
113
- - [location, issue, violated source, evidence, consequence, smallest safe correction]
118
+ - [location, issue, violated source, evidence, consequence, correction constraints or owning activity]
114
119
 
115
120
  #### Issues — Non-blocking
116
121
  - [location, issue, evidence, why it can be deferred]
@@ -119,16 +124,16 @@ Relationship to prior items (Review 2 or 3 only): [related consequence | indepen
119
124
  - [question, effect on judgment, required answer]
120
125
 
121
126
  #### Unresolved — Needs evidence
122
- - [concern, missing evidence, evidence needed]
127
+ - [claim, required observing boundary, available evidence and limit, why the gap affects judgment, smallest evidence that could disagree]
123
128
 
124
129
  #### Improvements
125
- - [improvement, benefit, supporting evidence]
130
+ - [only when materially relevant or requested: improvement, benefit, evidence]
126
131
 
127
132
  Evidence gaps: [unproved claims or none]
128
133
  ```
129
134
 
130
135
  ## Calibration
131
136
 
132
- Use a high evidence bar, not a high item count. Lead with the few items that can change the boundary judgment. Prior review, urgency, implementation effort, or author confidence does not establish correctness.
137
+ Lead with the few items that can change the boundary judgment. Prior review, urgency, implementation effort, or producer confidence does not establish correctness.
133
138
 
134
- The review is evidence for adjudication, not authority over source truth, owner decisions, corrections, or another independent dispatch. Pass, Non-blocking, Inconclusive, and Blocking are all valid exits.
139
+ The report is evidence for adjudication. It is not authority over source truth, owner decisions, corrections, or another independent dispatch. Pass, Non-blocking, Inconclusive, and Blocking are all valid exits.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Read this before reviewing work that changes trust boundaries, authentication, authorization, permissions, untrusted input, secrets, sensitive data, security-relevant dependencies or external integrations, code-execution boundaries, or failure behavior with security consequences.
4
4
 
5
- This lens helps frame review. It does not replace repo security policy, threat modeling, specialist review, or stack-specific hardening guidance.
5
+ This lens helps frame review. It does not replace repository security policy, threat modeling, specialist review, or stack-specific hardening guidance.
6
6
 
7
7
  ## Establish Authority
8
8
 
@@ -11,10 +11,10 @@ Identify:
11
11
  - assets and data requiring protection;
12
12
  - actors, roles, tenants, and privilege levels;
13
13
  - trust boundaries and external systems;
14
- - accepted security/privacy policy and threat model;
14
+ - accepted security and privacy policy and threat model;
15
15
  - compatibility and failure behavior that security controls must preserve.
16
16
 
17
- Security-sensitive product behavior remains user-owned. Do not invent access, retention, logging, or fail-open/closed policy during review.
17
+ Security-sensitive product behavior remains user-owned. Do not invent access, retention, logging, or fail-open or fail-closed policy during review.
18
18
 
19
19
  ## Trace The Paths
20
20
 
@@ -28,40 +28,42 @@ Review the affected path from boundary to effect:
28
28
  - secrets: source, scope, rotation, exposure, and logging;
29
29
  - execution: shell, file, URL, template, deserialization, plugin, or code-loading boundaries;
30
30
  - dependencies: provenance, permissions, known risk, update impact, and transitive behavior;
31
- - failure: partial state, retries, lockout, rate limits, rollback, and fail-open/closed behavior.
31
+ - failure: partial state, retries, lockout, rate limits, rollback, and fail-open or fail-closed behavior.
32
32
 
33
33
  Look for confused-deputy and cross-tenant paths, not only malformed input.
34
34
 
35
- ## Evidence
35
+ ## Require Boundary-Matched Evidence
36
36
 
37
37
  Prefer evidence at the real boundary:
38
38
 
39
- - tests proving allowed and denied roles/resources;
39
+ - tests proving allowed and denied roles and resources;
40
40
  - negative input and injection cases;
41
41
  - dependency or configuration inspection tied to the shipped artifact;
42
- - logs or traces demonstrating no secret/sensitive leakage;
42
+ - logs or traces demonstrating no secret or sensitive leakage;
43
43
  - failure-path tests for partial authorization, retry, and recovery;
44
44
  - specialist analysis for cryptography, sandboxing, identity protocols, or high-impact threats.
45
45
 
46
46
  A generic scanner pass cannot prove authorization logic or policy correctness. A unit test cannot prove deployed headers, identity configuration, or infrastructure permissions.
47
47
 
48
- Do not copy secrets, credentials, unrestricted personal data, or sensitive payloads into review context. Use the smallest sanitized evidence that supports the review item.
48
+ Do not copy secrets, credentials, unrestricted personal data, or sensitive payloads into review context. Use the smallest sanitized evidence that supports the item.
49
49
 
50
- ## Review Item Calibration
50
+ ## Calibrate Items
51
51
 
52
52
  Treat supported exploitable behavior, policy violation, unintended privilege or data exposure, unsafe failure semantics, secret leakage, or a missing required control as an Issue.
53
53
 
54
- Classify the Issue against the accepted security policy and reviewed boundary:
54
+ Classify it against accepted security policy and the reviewed boundary:
55
55
 
56
56
  - **Blocking:** crossing the boundary would remain unsafe, non-compliant, or contrary to a required control.
57
- - **Non-blocking:** the security issue is real but can be deferred safely without violating the accepted boundary.
57
+ - **Non-blocking:** the issue is real but can be deferred safely without violating the accepted boundary.
58
58
 
59
59
  Use **Question** when security behavior or accepted risk remains undecided. Use **Needs evidence** when a control may exist but the available test or environment cannot establish it.
60
60
 
61
- Treat materially useful defense-in-depth beyond the accepted boundary as an Improvement. Do not turn theoretical hardening, preference, or hypothetical completeness into an Issue.
61
+ Treat materially useful defense in depth beyond the accepted boundary as an Improvement. Omit theoretical hardening, preference, or hypothetical completeness.
62
62
 
63
- Do not omit an observed security issue merely because the selected lenses were narrower. Name the asset, path, precondition, consequence, evidence, and source requirement.
63
+ Do not omit an observed security issue because the selected lenses were narrower. Name the asset, path, precondition, consequence, evidence, and source requirement.
64
64
 
65
- ## Route
65
+ ## Return Through The Selected Role
66
66
 
67
- When security evidence changes the path, use [Workflow](../../workflow/SKILL.md) to choose what follows. Use [Diagnose Failure](../../diagnose-failure/SKILL.md) for unknown exploitability or root cause, [Decision Gate](../../decision-gate/SKILL.md) for missing policy or accepted-risk decisions, [Design For Depth](../../design-for-depth/SKILL.md) when trust decisions spread across callers, and [Launch Work](../../launch-work/SKILL.md) when the concern affects production rollout.
67
+ For self-review, return a route-changing security concern to [Workflow](../../../skills/workflow/SKILL.md). Use [Diagnose Failure](../../../skills/diagnose-failure/SKILL.md) for unknown exploitability or cause, [Decision Gate](../../../skills/decision-gate/SKILL.md) for missing policy or accepted-risk decisions, [Design For Depth](../../../skills/design-for-depth/SKILL.md) when trust decisions spread across callers, and [Launch Work](../../../skills/launch-work/SKILL.md) when the concern affects production rollout.
68
+
69
+ For independent review, classify the concern in the review report and stop. Do not route, correct, or dispatch follow-up. The receiving agent adjudicates the report and selects what follows.