singularity-forge/src/resources
Tom Boucher 01aea09f74 fix: add gsd_requirement_save and upsert path for requirement updates (#3249)
* fix: add gsd_requirement_save tool and upsert path for gsd_requirement_update (#2919)

gsd_requirement_update returned not_found for all requirements because
requirements written to REQUIREMENTS.md were never inserted into the DB,
and no create path existed. This adds:

- saveRequirementToDb() + nextRequirementId() in db-writer.ts (symmetric
  to saveDecisionToDb/nextDecisionId)
- gsd_requirement_save tool in db-tools.ts with auto-assigned IDs
- Upsert behavior in updateRequirementInDb() — creates a skeleton row
  when the requirement ID is not in the DB instead of throwing

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

* fix: add null check before reverting requirement on disk write failure

The `existing` variable from `getRequirementById` can be null when the
requirement was newly created (not previously in DB). Guard the revert
call to avoid passing null to `upsertRequirement`.

Fixes TypeScript error: 'Requirement | null' is not assignable to 'Requirement'

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 13:51:26 -06:00
..
agents fix: type errors in claude-import.ts and marketplace-discovery.ts 2026-03-16 14:46:31 -04:00
extensions fix: add gsd_requirement_save and upsert path for requirement updates (#3249) 2026-03-30 13:51:26 -06:00
skills fix(docs): use ~/.pi/agent/extensions/ for community extension install path (#3131) (#3259) 2026-03-30 13:50:25 -06:00
GSD-WORKFLOW.md feat: meaningful commit messages from task summaries (#803) 2026-03-16 23:30:33 -06:00