@codewalla_india/openspec 1.0.2 → 1.0.3
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.
|
@@ -304,7 +304,7 @@ export async function generateApplyInstructions(projectRoot, changeName, schemaN
|
|
|
304
304
|
state = 'blocked';
|
|
305
305
|
missingComprehension = true;
|
|
306
306
|
comprehension = gate.info;
|
|
307
|
-
instruction = `Complete the comprehension quiz in /opsx:apply before implementation (score ≥ ${gate.info.thresholdPercent}% on specs and tasks).`;
|
|
307
|
+
instruction = `Complete the comprehension quiz in /opsx:apply before implementation (score ≥ ${gate.info.thresholdPercent}% on proposal, design, specs, and tasks).`;
|
|
308
308
|
}
|
|
309
309
|
else if (gate.active && gate.info) {
|
|
310
310
|
comprehension = gate.info;
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* Interpolated into apply skill and slash command templates so agents run
|
|
5
5
|
* a spec comprehension gate before implementation.
|
|
6
6
|
*/
|
|
7
|
-
export declare const COMPREHENSION_QUIZ_GUIDANCE = "4. **Comprehension quiz (required before implementation)**\n\n After `openspec instructions apply --change \"<name>\" --json`, check comprehension status:\n\n - If `missingComprehension` is true OR `comprehension.required && !comprehension.passed`:\n - Do NOT edit application source code or mark task checkboxes yet\n - Read `contextFiles.specs`, `contextFiles.tasks` (or the `tasks` array in apply JSON)
|
|
7
|
+
export declare const COMPREHENSION_QUIZ_GUIDANCE = "4. **Comprehension quiz (required before implementation)**\n\n After `openspec instructions apply --change \"<name>\" --json`, check comprehension status:\n\n - If `missingComprehension` is true OR `comprehension.required && !comprehension.passed`:\n - Do NOT edit application source code or mark task checkboxes yet\n - Read `contextFiles.proposal`, `contextFiles.design`, `contextFiles.specs`, and `contextFiles.tasks` (or the `tasks` array in apply JSON)\n - Use `comprehension.questionCount` from the JSON as the number of questions\n\n **Generate questions**\n - Create exactly `comprehension.questionCount` multiple-choice questions\n - Each question MUST map to one artifact category:\n - **Proposal**: motivation, scope, or impact from `proposal.md`\n - **Design**: decisions, trade-offs, or approach from `design.md`\n - **Specs**: a `### Requirement:` or `#### Scenario:` from delta specs\n - **Tasks**: conceptual understanding of the implementation plan from pending (unchecked) tasks\n - When proposal, design, specs (with requirements), and pending tasks all exist, include at least one question from each category; fill remaining slots from any category\n - Do NOT use completed tasks as question sources\n - Each question: 4 options (1 correct from the source substance, 3 plausible distractors from other proposal/design/requirements/scenarios/task substance in the change)\n\n **Task question quality**\n - Test scope, approach, dependencies, sequencing rationale, or alignment with proposal/design\n - **Forbidden**: task numbers, checklist order, \"which task says X verbatim\", or answers identifiable only by task index or checkbox position\n - Good: \"What is the primary file where quiz rules are centralized?\" (answer from task substance)\n - Bad: \"Which task number updates `comprehension-guidance.ts`?\" or \"What is the exact text of task 2.1?\"\n\n **Present and grade**\n - Use the **AskUserQuestion tool** for each question (one at a time)\n - Grade: `score_percent = round(correct / question_count * 100)`\n - Pass when `score_percent >= comprehension.thresholdPercent` (default 80)\n\n **On failure (score below threshold)**\n - Announce score and that a new quiz is required\n - Update `.comprehension-session.yaml` in the change dir with `used_sources` from this attempt\n - Generate a NEW question set using different proposal/design/requirement/scenario/task sources (avoid `used_sources`)\n - Retry until pass\n\n **On pass**\n ```bash\n openspec instructions apply --change \"<name>\" --record-comprehension-pass --score <score> --attempt <n> --question-count <count> --json\n ```\n - Re-run `openspec instructions apply --change \"<name>\" --json`\n - Confirm `state` is `\"ready\"` and `comprehension.passed` is true before continuing\n\n **Output template**\n ```\n ## Applying: <change-name> \u2014 comprehension check\n\n Proposal, design, specs (<requirementCount> requirements, <scenarioCount> scenarios), tasks (<pendingTaskCount> pending) \u2192 <questionCount> questions\n\n Question 1/N: ...\n ...\n \u2713 Comprehension passed (<score>%, attempt <n>)\n ```\n\n Then continue to step 5 (show progress) and implementation.";
|
|
8
8
|
export declare const COMPREHENSION_APPLY_GUARDRAIL = "- NEVER implement code or mark tasks while `missingComprehension` is true\n- NEVER skip the comprehension quiz when the apply JSON requires it\n- If the user asks to skip the quiz, refuse and explain they must pass or set comprehension.enabled: false in openspec/config.yaml";
|
|
9
9
|
//# sourceMappingURL=comprehension-guidance.d.ts.map
|
|
@@ -10,17 +10,25 @@ export const COMPREHENSION_QUIZ_GUIDANCE = `4. **Comprehension quiz (required be
|
|
|
10
10
|
|
|
11
11
|
- If \`missingComprehension\` is true OR \`comprehension.required && !comprehension.passed\`:
|
|
12
12
|
- Do NOT edit application source code or mark task checkboxes yet
|
|
13
|
-
- Read \`contextFiles.specs\`, \`contextFiles.tasks\` (or the \`tasks\` array in apply JSON)
|
|
13
|
+
- Read \`contextFiles.proposal\`, \`contextFiles.design\`, \`contextFiles.specs\`, and \`contextFiles.tasks\` (or the \`tasks\` array in apply JSON)
|
|
14
14
|
- Use \`comprehension.questionCount\` from the JSON as the number of questions
|
|
15
15
|
|
|
16
16
|
**Generate questions**
|
|
17
17
|
- Create exactly \`comprehension.questionCount\` multiple-choice questions
|
|
18
|
-
- Each question MUST map to one
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
18
|
+
- Each question MUST map to one artifact category:
|
|
19
|
+
- **Proposal**: motivation, scope, or impact from \`proposal.md\`
|
|
20
|
+
- **Design**: decisions, trade-offs, or approach from \`design.md\`
|
|
21
|
+
- **Specs**: a \`### Requirement:\` or \`#### Scenario:\` from delta specs
|
|
22
|
+
- **Tasks**: conceptual understanding of the implementation plan from pending (unchecked) tasks
|
|
23
|
+
- When proposal, design, specs (with requirements), and pending tasks all exist, include at least one question from each category; fill remaining slots from any category
|
|
22
24
|
- Do NOT use completed tasks as question sources
|
|
23
|
-
- Each question: 4 options (1 correct from the source
|
|
25
|
+
- Each question: 4 options (1 correct from the source substance, 3 plausible distractors from other proposal/design/requirements/scenarios/task substance in the change)
|
|
26
|
+
|
|
27
|
+
**Task question quality**
|
|
28
|
+
- Test scope, approach, dependencies, sequencing rationale, or alignment with proposal/design
|
|
29
|
+
- **Forbidden**: task numbers, checklist order, "which task says X verbatim", or answers identifiable only by task index or checkbox position
|
|
30
|
+
- Good: "What is the primary file where quiz rules are centralized?" (answer from task substance)
|
|
31
|
+
- Bad: "Which task number updates \`comprehension-guidance.ts\`?" or "What is the exact text of task 2.1?"
|
|
24
32
|
|
|
25
33
|
**Present and grade**
|
|
26
34
|
- Use the **AskUserQuestion tool** for each question (one at a time)
|
|
@@ -30,7 +38,7 @@ export const COMPREHENSION_QUIZ_GUIDANCE = `4. **Comprehension quiz (required be
|
|
|
30
38
|
**On failure (score below threshold)**
|
|
31
39
|
- Announce score and that a new quiz is required
|
|
32
40
|
- Update \`.comprehension-session.yaml\` in the change dir with \`used_sources\` from this attempt
|
|
33
|
-
- Generate a NEW question set using different requirement/scenario/task sources (avoid \`used_sources\`)
|
|
41
|
+
- Generate a NEW question set using different proposal/design/requirement/scenario/task sources (avoid \`used_sources\`)
|
|
34
42
|
- Retry until pass
|
|
35
43
|
|
|
36
44
|
**On pass**
|
|
@@ -44,7 +52,7 @@ export const COMPREHENSION_QUIZ_GUIDANCE = `4. **Comprehension quiz (required be
|
|
|
44
52
|
\`\`\`
|
|
45
53
|
## Applying: <change-name> — comprehension check
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
Proposal, design, specs (<requirementCount> requirements, <scenarioCount> scenarios), tasks (<pendingTaskCount> pending) → <questionCount> questions
|
|
48
56
|
|
|
49
57
|
Question 1/N: ...
|
|
50
58
|
...
|