Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .cursor/commands/sdlc-spdd-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ Your job is to implement exactly one approved operation from a REASONS Canvas.
13. Update task status in the canvas and stage progress evidence via `./sdlc-spdd/scripts/sdlc.sh capture` (session record).
14. If the requested behavior conflicts with the canvas, stop and recommend `/sdlc-spdd-prompt-update` before changing code.
15. If no task is selected, ask which approved operation to implement before changing code.
16. Run Validation commands named on the selected canvas operation. If none,
16. Optional DIF check (never required). If `$DIF_HOME/scripts/dif-fold.sh` or a
sibling `../embabel-dif/scripts/dif-fold.sh` exists, run
`architect --quiet --canvas` on this Work ID. Exit 1: STOP and recommend
`/sdlc-spdd-architect` — do not implement. If the script is missing, continue
— that is not an error. Do not start a JVM from `sdlc.sh next` or `sdlc.sh gate`.
17. Run Validation commands named on the selected canvas operation. If none,
discover the project's documented test/lint/typecheck commands when they
exist.
17. On failure: do not mark the T## complete. Return the command output AND
18. On failure: do not mark the T## complete. Return the command output AND
the Norm/Safeguard it maps to. Host may retry in-session.
18. If the same verify command fails twice with the same error, STOP.
19. If the same verify command fails twice with the same error, STOP.
Recommend `/sdlc-spdd-prompt-update` or shelf. Do not loop forever.
19. After edits: `git diff --name-only` must stay within the active T##
20. After edits: `git diff --name-only` must stay within the active T##
`Files:` plus test paths. Extra paths: do not mark complete.

## Context Backend (runtime-resolved)
Expand Down
24 changes: 21 additions & 3 deletions .cursor/commands/sdlc-spdd-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,29 @@ Do not make code changes unless explicitly asked.
`readiness:`) to **Reviewed** (or **Complete** if Final Status is also Complete).
20. Recommend `/sdlc-spdd-prompt-update` for behavior or requirement changes before additional code changes.
21. Recommend `/sdlc-spdd-sync` for accepted non-behavioral refactors after review.
22. Run the operation-diff-scope machine check:
22. Optional DIF check (never required). If `$DIF_HOME/scripts/dif-fold.sh` or a
sibling `../embabel-dif/scripts/dif-fold.sh` exists **and** snapshot files
`sdlc-spdd/spdd/snapshots/<WORK-ID>-before.json` and `sdlc-spdd/spdd/snapshots/<WORK-ID>-after.json`
exist, run `review --quiet --before … --after … --canvas sdlc-spdd/spdd/canvas/<WORK-ID>.md`.
Exit 1: do not set Reviewed / Approved; cite the one-line `dif=blocked` (and
`.gate.json` / VerificationResult). If the CLI or either snapshot is missing,
continue — that is not an error. Do not use login fixtures. Do not start a
JVM from `sdlc.sh next` or `sdlc.sh gate`.
23. Run the operation-diff-scope machine check:
`./scripts/check-operation-diff-scope.sh --work-id <WORK-ID>`
(orchestrator: `./scripts/check-operation-diff-scope.sh`; installed
projects: `./sdlc-spdd/scripts/check-operation-diff-scope.sh`).
Exit 1: do not set Result to Approved or Approved With Notes.
projects: `./sdlc-spdd/scripts/check-operation-diff-scope.sh` or
`python -m sdlc_engine.canvas --work-id <WORK-ID>`). Optional
`--base <ref>` adds `git diff --name-only <ref>...HEAD`. Optional
`--ops T01,T02` limits Files: to those operations; default is
selected/completed T## (or all T## if none selected). Changed paths
must be a subset of those Files: plus allowed test paths
(`tests/**`, `engine/tests_unit/**`, `engine/tests_integration/**`,
`engine/tests_e2e/**`, or basename `test_*.py` / `*_test.py` /
`*.spec.md`). Exit 1 (extra production paths or `..` traversal):
do not set Result to Approved or Approved With Notes — use Changes
Requested or Blocked and list the extra paths. Hunk-level C-DRIFT
inside an allowed file remains a human finding.

## Context Backend (runtime-resolved)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Program detail: [Storage v3](docs/storage-v3.md)

## Current focus

**On main after [#264](https://github.com/jmjava/sdlc-spdd-orchestrator/pull/264)–[#269](https://github.com/jmjava/sdlc-spdd-orchestrator/pull/269):** Kasana I1–I3 on `/sdlc-spdd-code` and `/sdlc-spdd-review`, a copy-only `pre-commit.sample`, and this repo’s Cloud Agent `.cursor/environment.json`. Details: [Maintaining your project](docs/maintaining-your-project.md) · [Kasana overlay](docs/research/kasana-agent-harness-2-0.md).
**On main after [#264](https://github.com/jmjava/sdlc-spdd-orchestrator/pull/264)–[#270](https://github.com/jmjava/sdlc-spdd-orchestrator/pull/270):** Kasana I1–I3 on `/sdlc-spdd-code` and `/sdlc-spdd-review`, a copy-only `pre-commit.sample`, this repo’s Cloud Agent `.cursor/environment.json`, and the README sync for those contracts. Details: [Maintaining your project](docs/maintaining-your-project.md) · [Kasana overlay](docs/research/kasana-agent-harness-2-0.md).

**Product:** ADF template library + Vue3 ops console (unchanged).

Expand Down
4 changes: 4 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ real upgrade. CI: `.github/workflows/test-upgrade-consolidate.yml`.
`./tests/test-command-spec-generation.sh` asserts adapters match
`spec/commands/*.spec.md`, that `--check` detects drift, and parity validation still passes (FEAT-002).

`./tests/test-command-specs.sh` also locks dogfood `.cursor/commands/sdlc-spdd-code.md`
and `sdlc-spdd-review.md` to the shipped Cursor templates after
`framework_rewrite_adapter_paths` (Cloud Agents execute dogfood, not `templates/cursor/`).

`./tests/test-commit-message-command.sh` asserts `/sdlc-spdd-commit-message` adapters
exist with generate-only (no-commit) language, Python engine delegation
(`sdlc.sh commit-message`), and that generator `--check` plus adapter validation
Expand Down
22 changes: 22 additions & 0 deletions docs/contributing-command-specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ canonical spec per command. This removes hand-maintained three-way drift.
```

4. Commit **both** the spec and generated template files.
5. If you changed `lifecycle-code` or `lifecycle-review`, resync this repo's
dogfood Cursor hosts (Cloud Agents execute `.cursor/commands/`, not
`templates/cursor/`). Use the same rewrite `install-cursor-commands.sh`
applies when `sdlc-spdd/` exists — do not copy templates blindly:

```bash
# surgical: copy the two templates, then framework_rewrite_adapter_paths
# (see scripts/lib/framework-install.sh). Or:
./scripts/install-cursor-commands.sh --target . --force
```

`--force` rewrites **all** Cursor commands. Prefer the surgical copy+rewrite
when only code/review changed.

CI runs `generate-command-adapters.sh --check`, `validate-command-adapters.sh`, and
`tests/test-command-specs.sh` — stale adapters or missing semantic contracts fail the build.
Expand Down Expand Up @@ -115,6 +128,15 @@ If templates were edited by hand (avoid — prefer spec edits), refresh specs:
- **No posture language** in generated adapters (`make it work/right/fast` stays in orchestrator planning docs only). Enforced by `check-posture-boundary.sh`.
- **No new commands** under FEAT-002 — change existing commands only unless a new Work ID adds them.
- Parity contract is encoded in `validate-command-adapters.sh` — read it when adding sections.
- **Dogfood Cursor code/review must match shipped templates** except the
explicit path substitutions in `framework_rewrite_adapter_paths`
(`scripts/sdlc-spdd/` → `sdlc-spdd/scripts/`, `./scripts/sdlc.sh` →
`./sdlc-spdd/scripts/sdlc.sh`, `spdd/` → `sdlc-spdd/spdd/`, and the other
rewrite rules in that function). Do not add substitutions. Orchestrator-root
`./scripts/` parentheticals the rewrite leaves alone
(`./scripts/resolve-context-backend.sh`,
`./scripts/check-operation-diff-scope.sh`) must stay. Locked by
`tests/test-command-specs.sh`.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/research/kasana-agent-harness-2-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ I0 this note (done)
Uberorchbot does not replace I1–I3. Cursor Automations (or a human) start Cloud Agents that run them; the Uberorchbot plugin is opt-in behavior inside the VM: see [Uberorchbot via SDLC-SPDD](uberorchbot-via-sdlc-spdd.md) (U0–U5). The platform is Cursor Environments + Cloud Agents, not a second farm. Native Automation self-chaining is out of scope.
```

I1–I3 landed without promoting `LOCAL-001-kasana-harness-research`. The I3 copy-only leftover is done (#268). U2 (repo-managed `.cursor/environment.json`) is done in this repo. Next leftover is U3 in Uberorchbot. Do not invent a DOC/FEAT.
I1–I3 landed without promoting `LOCAL-001-kasana-harness-research`. The I3 copy-only leftover is done (#268). U2 (repo-managed `.cursor/environment.json`) is done in this repo. U3 (`sdlc-session` skill) is done in Uberorchbot (#16). Next leftover is U4 (live Automation save) in Uberorchbot — do not start it from this repo. Do not invent a DOC/FEAT.

### Out of plan (still not doing)

Expand Down
6 changes: 3 additions & 3 deletions docs/research/uberorchbot-via-sdlc-spdd.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ Do **not**:
| **U0** | Cloud Agents + Environments are the platform | this file (done) |
| **U1** | Read Uberorchbot; correct dispatcher assumptions | this file (done in the U1 amendment) |
| **U2** | Repo-managed `.cursor/environment.json`: `install` has `sdlc-engine`; builds enabled | this orchestrator (done) |
| **U3** | Opt-in `sdlc-session` skill: existing Work ID, gate, Resume Prompt, one phase, capture | Uberorchbot plugin |
| **U4** | Document and configure **separate** event-triggered Automations; re-check `gate` every run; shelf after repeat failure | Uberorchbot docs + Cursor Automations UI |
| **U3** | Opt-in `sdlc-session` skill: existing Work ID, gate, Resume Prompt, one phase, capture | Uberorchbot plugin (done — [Uberorchbot #16](https://github.com/jmjava/Uberorchbot/pull/16)) |
| **U4** | Document and configure **separate** event-triggered Automations; re-check `gate` every run; shelf after repeat failure | Uberorchbot docs + Cursor Automations UI (not started) |
| **U5** | Reuse regenerated `/sdlc-spdd-code` (I1); do not duplicate the four bullets in the plugin | this repo I1, then U3 |

U2 is done in this repo (committed `.cursor/environment.json` + `.cursor/install.sh`). U3–U4 are plugin + Automation configuration, not a new control plane.
U2 is done in this repo (committed `.cursor/environment.json` + `.cursor/install.sh`). U3 is done in Uberorchbot (#16). U4 is live Automation save — not started. Do not invent a DOC/FEAT.

## Claims allowed

Expand Down
53 changes: 53 additions & 0 deletions tests/test-command-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,59 @@ for adapter_file in \
"fail-closed approval in ${adapter_file#${REPO_ROOT}/templates/}"
done

# ---------------------------------------------------------------------------
echo "== Dogfood .cursor/commands parity (code / review) =="
# Cloud Agents and live-consumer in this checkout execute .cursor/commands/,
# not templates/cursor/. Allowlist vs shipped templates: only the substitutions
# in scripts/lib/framework-install.sh framework_rewrite_adapter_paths (the same
# rewrite install-cursor-commands.sh applies when sdlc-spdd/ exists).
# Orchestrator-root ./scripts/ parentheticals the rewrite leaves alone must stay.
# shellcheck source=../scripts/lib/framework-install.sh
source "${REPO_ROOT}/scripts/lib/framework-install.sh"

assert_dogfood_matches_rewritten_template() {
local slug="$1"
local expected
expected="$(mktemp)"
cp "${REPO_ROOT}/templates/cursor/${slug}.md" "${expected}"
framework_rewrite_adapter_paths "${expected}"
if diff -q "${expected}" "${REPO_ROOT}/.cursor/commands/${slug}.md" >/dev/null 2>&1; then
ok "dogfood ${slug} matches rewritten template"
else
bad "dogfood ${slug} drifted from templates/cursor/${slug}.md beyond rewrite allowlist"
diff -u "${expected}" "${REPO_ROOT}/.cursor/commands/${slug}.md" | head -40 >&2 || true
fi
rm -f "${expected}"
}

assert_dogfood_matches_rewritten_template sdlc-spdd-code
assert_dogfood_matches_rewritten_template sdlc-spdd-review
assert_contains "${REPO_ROOT}/.cursor/commands/sdlc-spdd-code.md" "Optional DIF check" \
"dogfood code has Optional DIF"
assert_contains "${REPO_ROOT}/.cursor/commands/sdlc-spdd-review.md" "Optional DIF check" \
"dogfood review has Optional DIF"
assert_contains "${REPO_ROOT}/.cursor/commands/sdlc-spdd-review.md" "python -m sdlc_engine.canvas" \
"dogfood review has full I2 check-operation-diff-scope text"
assert_contains "${REPO_ROOT}/.cursor/commands/sdlc-spdd-code.md" "./scripts/resolve-context-backend.sh" \
"dogfood code keeps orchestrator-root resolve-context-backend path"
assert_contains "${REPO_ROOT}/.cursor/commands/sdlc-spdd-review.md" "./scripts/check-operation-diff-scope.sh" \
"dogfood review keeps orchestrator-root check-operation-diff-scope path"

dog_code="${REPO_ROOT}/.cursor/commands/sdlc-spdd-code.md"
dog_bak="$(mktemp)"
cp "${dog_code}" "${dog_bak}"
printf '\n# dogfood-only drift\n' >> "${dog_code}"
expected="$(mktemp)"
cp "${REPO_ROOT}/templates/cursor/sdlc-spdd-code.md" "${expected}"
framework_rewrite_adapter_paths "${expected}"
if diff -q "${expected}" "${dog_code}" >/dev/null 2>&1; then
bad "dogfood parity compare missed injected drift"
else
ok "dogfood parity compare detects injected drift"
fi
cp "${dog_bak}" "${dog_code}"
rm -f "${dog_bak}" "${expected}"

# ---------------------------------------------------------------------------
echo "== Generator staleness check =="
expect_pass "generate --check clean tree" "${GEN}" --check
Expand Down
Loading