Skip to content

Commit e1a0f38

Browse files
fix(waterfall-lifecycle): address Copilot review — schema fields, enums, script bugs
- init-lifecycle.sh: use 'schema' field (not '$schema'), add missing required fields product_type/team/sponsor/updated to generated lifecycle-state.json - validate-schema.sh: fix schema file resolution (.json → .schema.json), update comments to reference 'schema'/'$schema' instead of '$id' - validate-artefact.sh: fix schema discovery to read 'schema'/'$schema' fields (not '$id'), fix schema filename resolution (.json → .schema.json) - phase-contract.schema.json: fix entry criteria status enum to YES/NO/PARTIAL/ not_assessed; fix exit criteria status enum to not_started/in_progress/met/waived - lifecycle-state.schema.json: add 'embedded' to product_type enum - risk-management/SKILL.md: fix HIGH threshold ≥10 (was ≥12), fix status 'flagged' → 'open' to match valid schema values - walkthrough-init-phase1.md: fix gate-reviews/ → gate-reports/ (matches init) - waterfall-lifecycle-status.md: clarify register files may not exist after init Generated by Nuno Salvação Co-Authored-By: Nexo <nexo.modeling@gmail.com>
1 parent 4543dd8 commit e1a0f38

8 files changed

Lines changed: 20 additions & 16 deletions

File tree

plugins/waterfall-lifecycle/commands/waterfall-lifecycle-status.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ This command is read-only and safe to run at any time. It does not modify `lifec
2828
1. Reads `lifecycle-state.json` from `.waterfall-lifecycle/`.
2929
2. Shows the current phase number, phase name, and status (`in_progress` / `ready_for_gate` / `approved` / `blocked`).
3030
3. Shows all 8 gates (A-H) with their current status (`pending` / `passed` / `failed` / `waived`), mapping each gate to its associated phase.
31-
4. Lists all open risk register entries with impact level `medium` or higher from `.waterfall-lifecycle/registers/risk-register.md`.
32-
5. Lists clarifications marked as `overdue` from `.waterfall-lifecycle/registers/clarification-log.md`.
31+
4. Lists all open risk register entries with impact level `medium` or higher from `.waterfall-lifecycle/registers/risk-register.md` (skipped if file does not exist yet).
32+
5. Lists clarifications marked as `overdue` from `.waterfall-lifecycle/registers/clarification-log.md` (skipped if file does not exist yet).
3333
6. Shows the elapsed time since `lifecycle-state.json` was last modified.
3434

3535
## Examples

plugins/waterfall-lifecycle/docs/walkthrough-init-phase1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The `lifecycle-orchestrator` agent runs and creates the directory structure unde
1616
.waterfall-lifecycle/
1717
lifecycle-state.json # Phase 1 active, gates A-H pending
1818
artefacts/phase-1/ # Phase 1 working directory
19-
gate-reviews/ # Gate review reports
19+
gate-reports/ # Gate review reports
2020
```
2121

2222
You are prompted to confirm the project name and product type.

plugins/waterfall-lifecycle/hooks/scripts/validate-artefact.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ if ! python3 -c "import json; json.load(open('${FILE_PATH}'))" 2>/dev/null; then
2424
exit 0
2525
fi
2626

27-
# Try schema validation if \$id field is present
27+
# Try schema validation if 'schema' or '$schema' field is present
2828
SCHEMA_ID=$(python3 -c "
2929
import json, sys
3030
try:
3131
d = json.load(open('${FILE_PATH}'))
32-
print(d.get('\$id', ''))
32+
print(d.get('schema', d.get('\$schema', '')))
3333
except Exception:
3434
print('')
3535
" 2>/dev/null || true)
3636

3737
if [[ -n "$SCHEMA_ID" && -n "${CLAUDE_PLUGIN_ROOT:-}" ]]; then
38-
SCHEMA_NAME=$(basename "$SCHEMA_ID" .json)
39-
SCHEMA_FILE="${CLAUDE_PLUGIN_ROOT}/schemas/${SCHEMA_NAME}.json"
38+
SCHEMA_NAME=$(basename "$SCHEMA_ID")
39+
SCHEMA_FILE="${CLAUDE_PLUGIN_ROOT}/schemas/${SCHEMA_NAME}.schema.json"
4040
if [[ -f "$SCHEMA_FILE" ]]; then
4141
if ! python3 -c "
4242
import json, sys

plugins/waterfall-lifecycle/schemas/lifecycle-state.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"product_type": {
2323
"type": "string",
24-
"enum": ["saas", "web", "desktop", "cli", "ai-ml", "data-product", "other"],
24+
"enum": ["saas", "web", "desktop", "cli", "ai-ml", "data-product", "embedded", "other"],
2525
"description": "Product type used for tailoring and gate configuration"
2626
},
2727
"team": {

plugins/waterfall-lifecycle/schemas/phase-contract.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
},
5353
"status": {
5454
"type": "string",
55-
"enum": ["not_started", "in_progress", "blocked", "ready_for_gate", "approved", "rejected", "waived", "closed"],
55+
"enum": ["YES", "NO", "PARTIAL", "not_assessed"],
5656
"description": "Fulfilment status of this entry criterion"
5757
}
5858
}
@@ -76,7 +76,7 @@
7676
},
7777
"status": {
7878
"type": "string",
79-
"enum": ["not_started", "in_progress", "blocked", "ready_for_gate", "approved", "rejected", "waived", "closed"],
79+
"enum": ["not_started", "in_progress", "met", "waived"],
8080
"description": "Fulfilment status of this exit criterion"
8181
},
8282
"evidence_ref": {

plugins/waterfall-lifecycle/scripts/init-lifecycle.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ mkdir -p "$WF_DIR/metrics"
6565
# Create lifecycle-state.json
6666
cat > "$WF_DIR/lifecycle-state.json" <<EOF
6767
{
68-
"\$schema": "waterfall-lifecycle/lifecycle-state",
68+
"schema": "waterfall-lifecycle/lifecycle-state",
6969
"version": "0.1.0",
7070
"project_name": "",
71+
"product_type": "other",
72+
"team": "",
73+
"sponsor": "",
7174
"created": "$TODAY",
75+
"updated": "$TODAY",
7276
"phases": {
7377
"1": {
7478
"name": "Opportunity and Feasibility",

plugins/waterfall-lifecycle/scripts/validate-schema.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
# validate-schema.sh — Validate a JSON file against its waterfall-lifecycle schema.
33
# Usage: ./validate-schema.sh <json-file> [schema-file]
4-
# If schema-file omitted, infers from $id field in json-file.
4+
# If schema-file omitted, infers from 'schema' or '$schema' field in json-file.
55
set -euo pipefail
66

77
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -15,7 +15,7 @@ usage() {
1515
echo "Arguments:"
1616
echo " json-file Path to the JSON file to validate"
1717
echo " schema-file Optional: path to JSON schema file"
18-
echo " If omitted, infers from \$id field in json-file"
18+
echo " If omitted, infers from 'schema' or '\$schema' field in json-file"
1919
echo ""
2020
echo "Examples:"
2121
echo " $(basename "$0") .waterfall-lifecycle/lifecycle-state.json"
@@ -65,7 +65,7 @@ if [[ -z "$SCHEMA_FILE" ]]; then
6565
if [[ -n "$SCHEMA_ID" ]]; then
6666
# Try to resolve schema relative to plugin schemas/ directory
6767
SCHEMA_NAME=$(basename "$SCHEMA_ID")
68-
CANDIDATE="$PLUGIN_DIR/schemas/${SCHEMA_NAME}.json"
68+
CANDIDATE="$PLUGIN_DIR/schemas/${SCHEMA_NAME}.schema.json"
6969
if [[ -f "$CANDIDATE" ]]; then
7070
SCHEMA_FILE="$CANDIDATE"
7171
else

plugins/waterfall-lifecycle/skills/risk-management/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ Assign one of the 7 formal risk categories:
6060

6161
Use the defined taxonomy. Ad-hoc labels are not accepted.
6262

63-
### Step 5: Handle HIGH Risks (score ≥ 12)
64-
- Flag the item immediately in the register (status: `flagged`)
63+
### Step 5: Handle HIGH Risks (score ≥ 10)
64+
- Flag the item immediately in the register (status: `open`)
6565
- Add the risk to the phase contract risk summary section
6666
- Include the risk in the gate review risk report
6767
- Define a mitigation action and assign an owner with a deadline

0 commit comments

Comments
 (0)