Skip to content

Pass --expect-updated from needs-analysis and learning-objectives - #232

Merged
savvides merged 6 commits into
mainfrom
cursor/skill-expect-updated-30ce
Nov 24, 2026
Merged

savvides merged 6 commits into
mainfrom
cursor/skill-expect-updated-30ce

Conversation

@savvides

@savvides savvides commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

/idstack:needs-analysis and /idstack:learning-objectives write manifest sections that other skills also write (context, needs_analysis, project_name, learning_objectives), and their merge calls omitted --expect-updated. A later save replaced the shared section when another session had written in the meantime. Both skills now read updated, pass --expect-updated when it is non-empty, and on exit 8 read the section again and merge once more. /idstack:course-import and /idstack:assessment-design already did this.

This change is only in skills/needs-analysis/SKILL.md.tmpl and skills/learning-objectives/SKILL.md.tmpl. scripts/idstack-gen-skills regenerated the two SKILL.md files. The merge script is unchanged.

Closes #226

Tests

The new checks were added to test/test-skill-shell-zsh.sh first. Before the template change, that suite failed the 20 new checks and the previous 275 still passed:

no bash block contains 'MANIFEST_UPDATED'
  FAIL: [bash] needs-analysis prints the manifest stamp (expected exit 0, got 1)
no bash block contains 'MANIFEST_UPDATED'
  FAIL: [bash] needs-analysis prints an empty manifest stamp when there is no manifest (expected exit 0, got 1)
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
AssertionError: placeholder '<updated value>' not in block
  FAIL: [bash] needs-analysis passes --expect-updated '2026-11-13T10:00:00Z' to the merge (expected exit 0, got 2)
        | grep: /tmp/tmp.jNcNPitJ3d/bash/stamp/merge.args: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
AssertionError: placeholder '<updated value>' not in block
  FAIL: [bash] needs-analysis passes --expect-updated 'x" $(touch pwned) `touch pwned`' to the merge (expected exit 0, got 2)
        | grep: /tmp/tmp.jNcNPitJ3d/bash/stamp/merge.args: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
AssertionError: placeholder '<updated value>' not in block
  FAIL: [bash] needs-analysis passes no --expect-updated when the stamp is empty (expected exit 0, got 1)
no bash block contains 'MANIFEST_UPDATED'
  FAIL: [bash] learning-objectives prints the manifest stamp (expected exit 0, got 1)
no bash block contains 'MANIFEST_UPDATED'
  FAIL: [bash] learning-objectives prints an empty manifest stamp when there is no manifest (expected exit 0, got 1)
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
AssertionError: placeholder '<updated value>' not in block
  FAIL: [bash] learning-objectives passes --expect-updated '2026-11-13T10:00:00Z' to the merge (expected exit 0, got 2)
        | grep: /tmp/tmp.jNcNPitJ3d/bash/stamp/merge.args: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
AssertionError: placeholder '<updated value>' not in block
  FAIL: [bash] learning-objectives passes --expect-updated 'x" $(touch pwned) `touch pwned`' to the merge (expected exit 0, got 2)
        | grep: /tmp/tmp.jNcNPitJ3d/bash/stamp/merge.args: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
AssertionError: placeholder '<updated value>' not in block
  FAIL: [bash] learning-objectives passes no --expect-updated when the stamp is empty (expected exit 0, got 1)

Results: 275/295 passed, 20 failed

The zsh leg failed the same 10 checks.

After the template change and scripts/idstack-gen-skills:

  PASS: [bash] needs-analysis prints the manifest stamp
  PASS: [bash] needs-analysis prints an empty manifest stamp when there is no manifest
  PASS: [bash] needs-analysis passes --expect-updated '2026-11-13T10:00:00Z' to the merge
  PASS: [bash] needs-analysis passes --expect-updated 'x" $(touch pwned) `touch pwned`' to the merge
  PASS: [bash] needs-analysis passes no --expect-updated when the stamp is empty
  PASS: [bash] learning-objectives prints the manifest stamp
  PASS: [bash] learning-objectives prints an empty manifest stamp when there is no manifest
  PASS: [bash] learning-objectives passes --expect-updated '2026-11-13T10:00:00Z' to the merge
  PASS: [bash] learning-objectives passes --expect-updated 'x" $(touch pwned) `touch pwned`' to the merge
  PASS: [bash] learning-objectives passes no --expect-updated when the stamp is empty

Results: 295/295 passed, 0 failed

The zsh leg passed the same 10 checks.

  • ./test/smoke-test.sh — Results: 695/695 passed, 0 failed
  • ./test/integration-test.sh — Results: 81/81 passed, 0 failed
  • scripts/idstack-gen-skills --dry-run is clean — The script examined 16 templates. 0 have problems.
  • Deferred findings have their own issue — none deferred
Open in Web Open in Cursor 

Note

Low Risk
Skill-documentation and shell-block changes only; merge tooling is unchanged and covered by existing shell tests.

Reviewed by Cursor Bugbot for commit 2c69989. Bugbot is set up for automated code reviews on this repo. Configure here.

cursoragent and others added 3 commits November 23, 2026 20:53
#226)

These two skills write sections that other skills also write, and their
merge calls omitted the stamp. A later save replaced the shared section.
They now read updated, pass --expect-updated, and on exit 8 read the
section again and merge once more.

Co-authored-by: Philippos Savvides <savvides@users.noreply.github.com>
…ILOs (#226)

A re-run that chose "update" could append new ILOs to the old ones.
Rows with the same ILO ID now replace the existing entry; "start again"
replaces the whole section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…objectives (#226)

Matches #219's smoke check for inline manifest reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@savvides savvides mentioned this pull request Nov 23, 2026
2 of 4 tasks
…t 8 (#226)

The merge wording from the earlier commit kept ILOs, matrix keys, gaps
and flags that the session dropped, so the manifest disagreed with the
report. The payload is again the full approved section. On exit 8 the
skill tells the user what changed and asks before it replaces it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@savvides

Copy link
Copy Markdown
Owner Author

Review (Claude Code session):

Findings and fixes

  1. Regression in learning-objectives (fixed in 14885f7). The PR changed the Write Manifest step from "replace the section with this session's data" to "read the existing section and add this session's results". The skill has no step that removes an entry, so ILOs, matrix keys, gaps and flags that the user dropped stayed in the manifest, and the manifest disagreed with the report. The exit-8 retry also merged after "start again". Now the payload is again the full approved section, as on main. On exit 8 the skill re-reads the section, tells the user what changed and asks (Replace / Stop). It does not merge without asking. (My intermediate commit 04c2af3 only reworded the merge; 14885f7 supersedes it.)
  2. UTF-8 manifest read (e93f64a). The two new MANIFEST_UPDATED reads now use open(..., encoding="utf-8"), so they pass the smoke check that Read manifest preferences as UTF-8 #219 adds.
  3. CHANGELOG. The needs-analysis and learning-objectives omit --expect-updated #226 entry now says that needs-analysis merges on retry and learning-objectives asks the user.

needs-analysis already read and merged the existing section on main (it keeps course-import's job_tasks), so its retry text matches main and was left as it is.

Tests: smoke 695/695, integration 81/81, test-skill-shell-zsh 295/295. No mutation anchor quotes the changed text. CI passes on all jobs except mutation, which is still running.

savvides and others added 2 commits November 23, 2026 21:50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@savvides
savvides merged commit 6fc50c7 into main Nov 24, 2026
10 checks passed
@savvides
savvides deleted the cursor/skill-expect-updated-30ce branch November 24, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

needs-analysis and learning-objectives omit --expect-updated

2 participants