@codyswann/lisa 8.10.0 → 8.10.1

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.
Files changed (106) hide show
  1. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  2. package/dist/core/upstream-evidence-manifest.json +17 -5
  3. package/package.json +4 -4
  4. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  5. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  6. package/plugins/lisa/.codex-plugin/skills/lisa-jira-read-ticket/SKILL.md +2 -0
  7. package/plugins/lisa/.codex-plugin/skills/lisa-linear-read-issue/SKILL.md +2 -0
  8. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
  9. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
  10. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
  11. package/plugins/lisa/rules/reference/tracked-work.md +8 -0
  12. package/plugins/lisa/skills/lisa-jira-read-ticket/SKILL.md +2 -0
  13. package/plugins/lisa/skills/lisa-linear-read-issue/SKILL.md +2 -0
  14. package/plugins/lisa/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
  15. package/plugins/lisa/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
  16. package/plugins/lisa/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
  17. package/plugins/lisa-agy/plugin.json +1 -1
  18. package/plugins/lisa-agy/skills/lisa-jira-read-ticket/SKILL.md +2 -0
  19. package/plugins/lisa-agy/skills/lisa-linear-read-issue/SKILL.md +2 -0
  20. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
  21. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
  22. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
  23. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  24. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  25. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  26. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  30. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-copilot/rules/reference/tracked-work.md +8 -0
  32. package/plugins/lisa-copilot/skills/lisa-jira-read-ticket/SKILL.md +2 -0
  33. package/plugins/lisa-copilot/skills/lisa-linear-read-issue/SKILL.md +2 -0
  34. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
  35. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
  36. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
  37. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-cursor/rules/tracked-work-reference.mdc +8 -0
  39. package/plugins/lisa-cursor/skills/lisa-jira-read-ticket/SKILL.md +2 -0
  40. package/plugins/lisa-cursor/skills/lisa-linear-read-issue/SKILL.md +2 -0
  41. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
  42. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
  43. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
  44. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  46. package/plugins/lisa-devin/rules/reference/tracked-work.md +8 -0
  47. package/plugins/lisa-devin/skills/lisa-jira-read-ticket/SKILL.md +2 -0
  48. package/plugins/lisa-devin/skills/lisa-linear-read-issue/SKILL.md +2 -0
  49. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
  50. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
  51. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
  52. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  54. package/plugins/lisa-expo-agy/plugin.json +1 -1
  55. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  59. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  61. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  62. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  66. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  68. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  69. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  73. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  75. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  76. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  80. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  82. package/plugins/lisa-rails-agy/plugin.json +1 -1
  83. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  87. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  89. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  90. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  94. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  95. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  96. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  97. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  101. package/plugins/src/base/rules/reference/tracked-work.md +8 -0
  102. package/plugins/src/base/skills/lisa-jira-read-ticket/SKILL.md +2 -0
  103. package/plugins/src/base/skills/lisa-linear-read-issue/SKILL.md +2 -0
  104. package/plugins/src/base/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
  105. package/plugins/src/base/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
  106. package/plugins/src/base/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
@@ -27,9 +27,9 @@ export const NIGHTLY_E2E_GUARD_BEHAVIOR_CERTIFICATES = Object.freeze({
27
27
  }),
28
28
  "4679c1e7cc92f960bad81854b9ce68a14aa0e404f2264cca0c2d6186008a17eb": Object.freeze({
29
29
  contractVersion: "1.9.0",
30
- packageVersions: Object.freeze(["8.10.0"]),
30
+ packageVersions: Object.freeze(["8.10.1"]),
31
31
  provenances: Object.freeze([
32
- "workspace package @codyswann/lisa@8.10.0 (typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs)",
32
+ "workspace package @codyswann/lisa@8.10.1 (typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs)",
33
33
  ]),
34
34
  }),
35
35
  "898ee0247806c7aa6e98328662d80bcff22ff067999298865462a58daef8bb22": Object.freeze({
@@ -682,7 +682,7 @@
682
682
  "plugins/src/base/rules/reference/settled-decisions.md": "53064fc04010e330cce04459bb2e26e39b4868117376319fe303caafffe0f910",
683
683
  "plugins/src/base/rules/reference/stale-state-claims.md": "ea788d884c297ef8c8b573625172cdb123bb80690907cea0efa789b8dd60e466",
684
684
  "plugins/src/base/rules/reference/tool-access-gate.md": "057743e865bbfaa96f753a69046d3c1b554aba2b9d015790fb6f8c8d6c6b7fa7",
685
- "plugins/src/base/rules/reference/tracked-work.md": "709ca5c6f09d28dfb240aafc92bbc38748d2fcfeabbc1c418232719ecec59ad1",
685
+ "plugins/src/base/rules/reference/tracked-work.md": "057883675900eb72af52741d0b5ae730383b6d8b78bb85e80cefa0fc5cc29c86",
686
686
  "plugins/src/base/rules/reference/upstream-to-lisa.md": "6b82577bf182fa1ed05e8dc3e1f68d9f76eb1eb7497de75031595db488c396de",
687
687
  "plugins/src/base/rules/reference/usage-accounting.md": "53dec94f4cba696d4b4f6e990565173c6aa0c9972432b8b127517fc3617ca7cc",
688
688
  "plugins/src/base/rules/reference/verification.md": "cb8d03601dcc4ed4fb8e2bfd0aa9d7879dfa00be3401d6a33864a8c34cde38ef",
@@ -814,7 +814,7 @@
814
814
  "plugins/src/base/skills/lisa-jira-journey/SKILL.md": "f2374a818c92d28c6f2f4c494f171522ca42ceaf27be3648839b31a9dbb86444",
815
815
  "plugins/src/base/skills/lisa-jira-journey/scripts/generate-templates.py": "abd50e33b1f6038e4b92bcc76b29e92f78aa03a7302923fd46d24049ba6fce04",
816
816
  "plugins/src/base/skills/lisa-jira-journey/scripts/parse-plan.py": "a96fda5de44cd6d65fcc7ecf36aa365766707b77ad68b198062124d31a9238b9",
817
- "plugins/src/base/skills/lisa-jira-read-ticket/SKILL.md": "14b3950f6cf4d16d9ca3bf73d59b0b7a4f240b3b357fb5a8399949d4ecc97651",
817
+ "plugins/src/base/skills/lisa-jira-read-ticket/SKILL.md": "1a971d36f065a2e4bced29f23a3a035ae9c9f1070f743fefd99b4e6ecf63d755",
818
818
  "plugins/src/base/skills/lisa-jira-read-ticket/scripts/download-attachment.sh": "f50f532ee0142b61b4d16c4c61f49ee06fdf78c5edd870fbcfbc13b41f8ab519",
819
819
  "plugins/src/base/skills/lisa-jira-sync/SKILL.md": "943a89c2fd70b7cd1f13badc8ce0018f9f5ff18a0a7443440ba68a309bf4685f",
820
820
  "plugins/src/base/skills/lisa-jira-validate-ticket/SKILL.md": "00138cd88d4cd8dc0ebdd59b9e37433553102c994fb3f0e8ec35e3af76f99ade",
@@ -832,7 +832,7 @@
832
832
  "plugins/src/base/skills/lisa-linear-evidence/SKILL.md": "247c5bbf74bb34c4d755a4c804fc80170e50f9c227ab7152dff98a32b4118eb5",
833
833
  "plugins/src/base/skills/lisa-linear-journey/SKILL.md": "3eeea6854a1e2314dc593afefd45774d154ab1d0f537440813c02334ce03ac34",
834
834
  "plugins/src/base/skills/lisa-linear-prd-intake/SKILL.md": "add3303cd5dbf250df622c7d5fed36bd7f27a2016505eeef4c610a40c2bceec1",
835
- "plugins/src/base/skills/lisa-linear-read-issue/SKILL.md": "f500cb40b157b456a25de8ef9e175764db1686306a548f210615a216aae457d6",
835
+ "plugins/src/base/skills/lisa-linear-read-issue/SKILL.md": "896fb5345aa41d4f55989044341a02e5e6e0f93d7debb7708bfc6c28df70baee",
836
836
  "plugins/src/base/skills/lisa-linear-sync/SKILL.md": "96108cea578ca29d4a05d9d115e1b433b2f5e166a8da74878f760041d1e600cc",
837
837
  "plugins/src/base/skills/lisa-linear-to-tracker/SKILL.md": "af8efdcd13d0e30f729938a8c70674be58fd7113f2ad723ab5ebad7ea42ac5ce",
838
838
  "plugins/src/base/skills/lisa-linear-validate-issue/SKILL.md": "51b2ae5d16105a9dd4875acc8f12f0ed0ecbd784be2ac06be1db255c1e48c4a4",
@@ -903,10 +903,10 @@
903
903
  "plugins/src/base/skills/lisa-secrets-access/scripts/surfaces.mjs": "d9259269fd2d0a8387bef8a13c9d167bd1f9d20dd58e6b51ce02119dfe1d4c87",
904
904
  "plugins/src/base/skills/lisa-secrets-access/scripts/sync-secret-to-ci.mjs": "8c5b8e5aa775420d0778436666c9b03b67fae443809d9b5fd57ebf0f04d9a4e2",
905
905
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-access.mjs": "ee88c5f1d39e11c2d7233df255bdbb2246be808baa7825173111edaa8517a490",
906
- "plugins/src/base/skills/lisa-secrets-access/scripts/task-action.mjs": "4b8a615aa24833712dedcd4317af30bf267fb8b2509f42ba3123a225611f9d55",
906
+ "plugins/src/base/skills/lisa-secrets-access/scripts/task-action.mjs": "8bbc8f7d8c30823a87574b90bfec6abc877a59b159764d6577132133216a145b",
907
907
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-atlassian-native.mjs": "b9231c667bb62d3d30edf1a45d632696fc3c1d81ae8b32652e5e37a9635cb2f4",
908
908
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-context-data.mjs": "14a1a873e92e45cc4e1f50ca6bf93484ad78315249e39c62772c6e4d2d305eed",
909
- "plugins/src/base/skills/lisa-secrets-access/scripts/task-context-write.mjs": "eeaa6baeb18f6a6c22cf2760f6680db957b201bc712eefd85621243a4ef5cc9a",
909
+ "plugins/src/base/skills/lisa-secrets-access/scripts/task-context-write.mjs": "db365b7f05eef81eb4505e883eb124e4bbb2a24db7dc8c7848b12215d57d628d",
910
910
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-github.mjs": "0bf7565d018b08650a66a94ad147a5fc201ce1c1ca9fc2289ddf72a445217a3e",
911
911
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-intake-read.mjs": "e64cb5dc2564101021925ddb739b6a6c5f0d40423f7995bb8a8d8bcfdf34bed2",
912
912
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-intake.mjs": "fff789e59bd91ede71eefaffe38cc166c821e5a9291efb401fc81710cf8f6118",
@@ -918,6 +918,7 @@
918
918
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-readiness.mjs": "dc29611bc57a0cabefe1e7631659bc6d85b487eed19b7483bfb7fc443b175273",
919
919
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-requirements.mjs": "e184ed7fb4eacb448553cca5a1c440707449066ef9edddb81f6eeba8b79e879d",
920
920
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs": "775b202a5611f3f6aeaec15eb7abb1659604fa687d62f41e40e7701dfa137895",
921
+ "plugins/src/base/skills/lisa-secrets-access/scripts/task-unbound.mjs": "2b4199a63e09e242af6a5ee5f4efe24bd50bac6f4a62ab978906e866a31bea55",
921
922
  "plugins/src/base/skills/lisa-secrets-access/scripts/tools-from-notes.mjs": "6ab78776157345992224c5f74f1e6b82867d003961499faf2e51f1473c78dbb8",
922
923
  "plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs": "dac2bad3b92355c71fa9ecb5c484b17ad042e7e33dcdbcadf381d4fc13ab15f9",
923
924
  "plugins/src/base/skills/lisa-security-audit-handling/SKILL.md": "cc0fd59927cc13fc3cfa59eb07852b8c8373c9021b42e016229e632b8fbcc916",
@@ -3711,6 +3712,7 @@
3711
3712
  "plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-readiness.mjs": true,
3712
3713
  "plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-requirements.mjs": true,
3713
3714
  "plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs": true,
3715
+ "plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-unbound.mjs": true,
3714
3716
  "plugins/lisa-agy/skills/lisa-secrets-access/scripts/tools-from-notes.mjs": true,
3715
3717
  "plugins/lisa-agy/skills/lisa-secrets-access/scripts/validate-config.mjs": true,
3716
3718
  "plugins/lisa-agy/skills/lisa-security-audit-handling/SKILL.md": true,
@@ -4308,6 +4310,7 @@
4308
4310
  "plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-readiness.mjs": true,
4309
4311
  "plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-requirements.mjs": true,
4310
4312
  "plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs": true,
4313
+ "plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-unbound.mjs": true,
4311
4314
  "plugins/lisa-copilot/skills/lisa-secrets-access/scripts/tools-from-notes.mjs": true,
4312
4315
  "plugins/lisa-copilot/skills/lisa-secrets-access/scripts/validate-config.mjs": true,
4313
4316
  "plugins/lisa-copilot/skills/lisa-security-audit-handling/SKILL.md": true,
@@ -4889,6 +4892,7 @@
4889
4892
  "plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-readiness.mjs": true,
4890
4893
  "plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-requirements.mjs": true,
4891
4894
  "plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs": true,
4895
+ "plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-unbound.mjs": true,
4892
4896
  "plugins/lisa-cursor/skills/lisa-secrets-access/scripts/tools-from-notes.mjs": true,
4893
4897
  "plugins/lisa-cursor/skills/lisa-secrets-access/scripts/validate-config.mjs": true,
4894
4898
  "plugins/lisa-cursor/skills/lisa-security-audit-handling/SKILL.md": true,
@@ -5399,6 +5403,7 @@
5399
5403
  "plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-readiness.mjs": true,
5400
5404
  "plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-requirements.mjs": true,
5401
5405
  "plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs": true,
5406
+ "plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-unbound.mjs": true,
5402
5407
  "plugins/lisa-devin/skills/lisa-secrets-access/scripts/tools-from-notes.mjs": true,
5403
5408
  "plugins/lisa-devin/skills/lisa-secrets-access/scripts/validate-config.mjs": true,
5404
5409
  "plugins/lisa-devin/skills/lisa-security-audit-handling/SKILL.md": true,
@@ -7645,6 +7650,7 @@
7645
7650
  "plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-readiness.mjs": true,
7646
7651
  "plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-requirements.mjs": true,
7647
7652
  "plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs": true,
7653
+ "plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-unbound.mjs": true,
7648
7654
  "plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/tools-from-notes.mjs": true,
7649
7655
  "plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/validate-config.mjs": true,
7650
7656
  "plugins/lisa/.codex-plugin/skills/lisa-security-audit-handling/SKILL.md": true,
@@ -8411,6 +8417,7 @@
8411
8417
  "plugins/lisa/skills/lisa-secrets-access/scripts/task-readiness.mjs": true,
8412
8418
  "plugins/lisa/skills/lisa-secrets-access/scripts/task-requirements.mjs": true,
8413
8419
  "plugins/lisa/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs": true,
8420
+ "plugins/lisa/skills/lisa-secrets-access/scripts/task-unbound.mjs": true,
8414
8421
  "plugins/lisa/skills/lisa-secrets-access/scripts/tools-from-notes.mjs": true,
8415
8422
  "plugins/lisa/skills/lisa-secrets-access/scripts/validate-config.mjs": true,
8416
8423
  "plugins/lisa/skills/lisa-security-audit-handling/SKILL.md": true,
@@ -9052,6 +9059,7 @@
9052
9059
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-readiness.mjs": true,
9053
9060
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-requirements.mjs": true,
9054
9061
  "plugins/src/base/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs": true,
9062
+ "plugins/src/base/skills/lisa-secrets-access/scripts/task-unbound.mjs": true,
9055
9063
  "plugins/src/base/skills/lisa-secrets-access/scripts/tools-from-notes.mjs": true,
9056
9064
  "plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs": true,
9057
9065
  "plugins/src/base/skills/lisa-security-audit-handling/SKILL.md": true,
@@ -13277,6 +13285,7 @@
13277
13285
  "tests/unit/secrets/task-readiness-postlaunch.test.ts": true,
13278
13286
  "tests/unit/secrets/task-readiness-qualification.test.ts": true,
13279
13287
  "tests/unit/secrets/task-readiness-scope.test.ts": true,
13288
+ "tests/unit/secrets/task-readiness-unbound.test.ts": true,
13280
13289
  "tests/unit/secrets/task-readiness.test.ts": true,
13281
13290
  "tests/unit/secrets/task-requirements.test.ts": true,
13282
13291
  "tests/unit/secrets/task-review-regressions.test.ts": true,
@@ -20402,6 +20411,7 @@
20402
20411
  "5f54fa71d5bcbf41f3d7e4d9ded71163721e3c0f": true,
20403
20412
  "5f55e0b949a93a2ce2a1adfc3ccf5c7d2de71ebf": true,
20404
20413
  "5f55ecb090e256d2379726b1e1b7f3aa0a24020c": true,
20414
+ "5f566cfd5ed74a068d1c03f43076abd7568e1077": true,
20405
20415
  "5f57c378f40453fbb1c662d57c5fc79641a8fa6f": true,
20406
20416
  "5f5a4db15627982511c3f23739efd514ab9edddf": true,
20407
20417
  "5f5dd0d53861726b5a7efa1b9e0a81f132a48e46": true,
@@ -22607,6 +22617,7 @@
22607
22617
  "7fa05d183b1c1cf7d2b4d9755789002d4865a212": true,
22608
22618
  "7fa173bef71c0c645f90cf10d1eb3a999cea38cb": true,
22609
22619
  "7fa647282aaf3f8bb0c692fb98747881131ad8f2": true,
22620
+ "7fa673a4305ac737c70a556f73663bd5ad8518c7": true,
22610
22621
  "7fa8e7990f5004d70aa9b2f5f2eedbdb3171ad32": true,
22611
22622
  "7fa9e4bc856d8108e5b28b8079c2089efa0336b9": true,
22612
22623
  "7fabfb35fe5ebed1397491b24483207cd2aa67bb": true,
@@ -22676,6 +22687,7 @@
22676
22687
  "80de69a1323594db6a0665c8485872ab668e8231": true,
22677
22688
  "80de8fa4f9722d025d53a3d90fc80d02f5f86f6a": true,
22678
22689
  "80df08a2a9d2364cdbf3ad222dfe5ff33bf72d94": true,
22690
+ "80df24bd33db0cc357d94612ed838bd1f97849c7": true,
22679
22691
  "80e4f8f04e9c600db724bd177d28250dcb2bf4e4": true,
22680
22692
  "80e88559dc99d65ae989818d36a0af1b4b31a07b": true,
22681
22693
  "80e8bc2250c300dc0a9147fbae9f9e5753f7ba6a": true,
package/package.json CHANGED
@@ -200,7 +200,7 @@
200
200
  "zod": "^4.6.7"
201
201
  },
202
202
  "name": "@codyswann/lisa",
203
- "version": "8.10.0",
203
+ "version": "8.10.1",
204
204
  "description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
205
205
  "main": "dist/index.js",
206
206
  "exports": {
@@ -371,7 +371,7 @@
371
371
  "optional": true
372
372
  }
373
373
  },
374
- "lisaReleaseCommit": "80df24bd33db0cc357d94612ed838bd1f97849c7",
375
- "gitHead": "80df24bd33db0cc357d94612ed838bd1f97849c7",
376
- "lisaReleaseTag": "v8.10.0"
374
+ "lisaReleaseCommit": "e40d3f862c559f5c12c8f2c06f494bfb45627df3",
375
+ "gitHead": "e40d3f862c559f5c12c8f2c06f494bfb45627df3",
376
+ "lisaReleaseTag": "v8.10.1"
377
377
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "8.10.0",
3
+ "version": "8.10.1",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "8.10.0",
3
+ "version": "8.10.1",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -21,6 +21,8 @@ node /absolute/lisa-secrets-access/scripts/preflight-secrets.mjs --tracker-intak
21
21
  node /absolute/lisa-secrets-access/scripts/preflight-secrets.mjs --tracker-intake-read --ref PROJ-123 --read comments
22
22
  ```
23
23
 
24
+ The same two commands are the read for a session with no ticket bound, for example a question about an issue: the task-readiness guard admits them, and its `work-item-unbound` refusal names them with the installed path. Do not bind a ticket just to read one.
25
+
24
26
  The token route returns the full issue and remote links, and the comments command reads all pages in order. If the token is unavailable, the command can read the issue through an already authenticated `acli` session on the configured site. That route reports `remoteLinks: null` and returns comments only when the embedded page is complete. Use the Atlassian access owner's native Jira issue and remote-link reads against the configured cloud and issue key to fill missing data. Check the embedded comment total before treating native context as complete.
25
27
 
26
28
  ## Phase 1 — Resolve Context
@@ -27,6 +27,8 @@ node /absolute/lisa-secrets-access/scripts/preflight-secrets.mjs --tracker-intak
27
27
  node /absolute/lisa-secrets-access/scripts/preflight-secrets.mjs --tracker-intake-read --ref ENG-123 --read comments
28
28
  ```
29
29
 
30
+ The same two commands are the read for a session with no ticket bound, for example a question about an issue: the task-readiness guard admits them, and its `work-item-unbound` refusal names them with the installed path. Do not bind a ticket just to read one.
31
+
30
32
  The issue response includes the primary body, team, and related graph fields. The comments command returns the entire paginated comment list or fails. Fetch related issues in the configured team with the same command and their issue keys. If a graph field reports another page, record the context as incomplete until those related records can be read through the access owner.
31
33
 
32
34
  If the token route is unavailable, load `lisa-linear-access` and use its native Linear MCP fallback. List teams with the configured team key as `query`, verify the configured workspace and team, then read the issue by its key. Use the resulting issue identifier or UUID for the comment pages. This read-only path leaves the requirements header and access check to the normal task flow.
@@ -9,6 +9,7 @@ import { readTaskRequirements } from "./task-requirements.mjs";
9
9
  import { lifecycleEvents, resetNativeEvent } from "./task-native-lifecycle.mjs";
10
10
  import { intakeRead } from "./task-intake.mjs";
11
11
  import { nativeContext } from "./task-native-context.mjs";
12
+ import { unboundRefusal, unboundWrite } from "./task-unbound.mjs";
12
13
  import {
13
14
  linearIntakeRead,
14
15
  observeLinearIntake,
@@ -177,7 +178,8 @@ export function runTaskAction(argv = process.argv) {
177
178
  result = failure("requirements-stale");
178
179
  else if (hook && result.code === "no-active-task") {
179
180
  if (cfg.provenance?.status === "absent") return;
180
- result = failure("requirements-stale");
181
+ if (unboundWrite(input, cfg)) return;
182
+ result = unboundRefusal(cfg);
181
183
  } else if (hook && result.outcome === "NATIVE_OWNER_REQUIRED") {
182
184
  const decision = nativeAction(cfg, header, result, input);
183
185
  if (decision.allowed) result = { allowed: true, code: decision.code };
@@ -90,19 +90,29 @@ export function writeRequirementsContext(
90
90
  if (error.code !== "ENOENT") fail();
91
91
  initial = true;
92
92
  }
93
+ const freshBody =
94
+ typeof input.context_body === "string" &&
95
+ !input.context_body.startsWith(marker);
96
+ // Re-binding the checkout to another item leaves the previous item's
97
+ // context behind. With the binding already naming `ref`, that context
98
+ // belongs to no current work: a fresh body for `ref` replaces it, so the
99
+ // prepare step that follows a re-bind does not dead-end the session.
100
+ let replacing = false;
93
101
  if (initial) {
94
- if (
95
- typeof input.context_body !== "string" ||
96
- input.context_body.startsWith(marker)
97
- )
98
- fail();
102
+ if (!freshBody) fail();
99
103
  } else {
100
104
  try {
101
- if (realpathSync(path) !== path || input.context_body !== undefined)
102
- fail();
105
+ if (realpathSync(path) !== path) fail();
103
106
  } catch {
104
107
  fail();
105
108
  }
109
+ const previous = previousItem(readFileSync(path, "utf8"), marker);
110
+ replacing =
111
+ freshBody &&
112
+ binding?.ref === ref &&
113
+ previous !== null &&
114
+ previous !== ref;
115
+ if (input.context_body !== undefined && !replacing) fail();
106
116
  }
107
117
  const eas = join(cfg.projectRoot, ".easignore");
108
118
  if (
@@ -113,7 +123,8 @@ export function writeRequirementsContext(
113
123
  )
114
124
  fail();
115
125
  ensureIgnored(cfg.projectRoot);
116
- let body = initial ? input.context_body : readFileSync(path, "utf8");
126
+ let body =
127
+ initial || replacing ? input.context_body : readFileSync(path, "utf8");
117
128
  if (body.startsWith(marker)) {
118
129
  const end = body.indexOf("\n-->\n");
119
130
  if (end < 0) fail();
@@ -154,5 +165,25 @@ export function writeRequirementsContext(
154
165
  } finally {
155
166
  rmSync(staging, { recursive: true, force: true });
156
167
  }
157
- return { code: "requirements-prepared", body_preserved: true };
168
+ return { code: "requirements-prepared", body_preserved: !replacing };
169
+ }
170
+
171
+ /**
172
+ * The work item a prepared context names, or null when it names none.
173
+ * @param {string} current The context file's text.
174
+ * @param {string} marker The requirements header's opening line.
175
+ * @returns {string|null} The previous work item reference.
176
+ */
177
+ function previousItem(current, marker) {
178
+ if (!current.startsWith(marker)) return null;
179
+ const end = current.indexOf("\n-->\n");
180
+ if (end < 0) return null;
181
+ try {
182
+ const header = JSON.parse(current.slice(marker.length, end));
183
+ return typeof header?.work_item_ref === "string"
184
+ ? header.work_item_ref
185
+ : null;
186
+ } catch {
187
+ return null;
188
+ }
158
189
  }
@@ -0,0 +1,169 @@
1
+ /**
2
+ * What a session with no work item bound may still do, and what it is told.
3
+ *
4
+ * With no binding and no prepared context there is no task whose access could
5
+ * be proved, so the guard refuses project work. Two things are not project
6
+ * work and stay possible: reading (the fixed read commands the guard already
7
+ * admits), and writing a file that lands in no git repository at all, such as
8
+ * an agent's scratch or memory file. The refusal names the read command for
9
+ * this installation, because an agent cannot guess an absolute plugin path.
10
+ */
11
+ import { existsSync, realpathSync, statSync } from "node:fs";
12
+ import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
13
+ import { fileURLToPath } from "node:url";
14
+ import {
15
+ configuredIssueRepository,
16
+ issueFields,
17
+ } from "../../lisa-github-read-issue/read-contract.mjs";
18
+
19
+ const owner = join(
20
+ dirname(fileURLToPath(import.meta.url)),
21
+ "preflight-secrets.mjs"
22
+ );
23
+ const FILE_TOOLS = new Set(["Write", "Edit", "MultiEdit", "write", "edit"]);
24
+ const PATCH_TARGET =
25
+ /^\*\*\* (?:Add File|Update File|Delete File|Move to): (.*)$/;
26
+
27
+ /**
28
+ * The real location a path would be written to: the deepest existing
29
+ * ancestor's real path, with the not-yet-existing remainder appended.
30
+ * @param {string} target Absolute path.
31
+ * @returns {string|null} Resolved location, or null when unresolvable.
32
+ */
33
+ function realLocation(target) {
34
+ let existing = target;
35
+ while (!existsSync(existing)) {
36
+ const parent = dirname(existing);
37
+ if (parent === existing) return null;
38
+ existing = parent;
39
+ }
40
+ try {
41
+ return join(realpathSync(existing), relative(existing, target));
42
+ } catch {
43
+ return null;
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Whether any directory from `location` up to the root holds `.git`.
49
+ * @param {string} location Resolved absolute path.
50
+ * @returns {boolean} True when the path is inside a git repository.
51
+ */
52
+ function insideRepository(location) {
53
+ for (let dir = location; ; dir = dirname(dir)) {
54
+ try {
55
+ statSync(join(dir, ".git"));
56
+ return true;
57
+ } catch (error) {
58
+ if (!["ENOENT", "ENOTDIR"].includes(error.code)) return true;
59
+ }
60
+ if (dirname(dir) === dir) return false;
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Whether a write to `target` changes no project: it resolves outside the
66
+ * project and outside every git repository. Any doubt is a refusal.
67
+ * @param {unknown} target The path the tool names.
68
+ * @param {string} projectRoot This project's root.
69
+ * @returns {boolean} True when the write touches no repository.
70
+ */
71
+ export function outsideEveryRepository(target, projectRoot) {
72
+ if (typeof target !== "string" || !isAbsolute(target)) return false;
73
+ const location = realLocation(resolve(target));
74
+ if (!location) return false;
75
+ let root;
76
+ try {
77
+ root = realpathSync(projectRoot);
78
+ } catch {
79
+ return false;
80
+ }
81
+ if (location === root || location.startsWith(root + sep)) return false;
82
+ return !insideRepository(location);
83
+ }
84
+
85
+ /**
86
+ * Every path a file-writing tool call names, or null for any other shape.
87
+ * @param {Record<string, any>} input Hook event.
88
+ * @returns {string[]|null} Target paths.
89
+ */
90
+ function writeTargets(input) {
91
+ const args = input?.tool_input;
92
+ if (!args || typeof args !== "object") return null;
93
+ if (FILE_TOOLS.has(input.tool_name)) {
94
+ const target = args.file_path ?? args.filePath;
95
+ return typeof target === "string" ? [target] : null;
96
+ }
97
+ if (input.tool_name === "NotebookEdit")
98
+ return typeof args.notebook_path === "string" ? [args.notebook_path] : null;
99
+ if (input.tool_name === "apply_patch" && typeof args.command === "string") {
100
+ const targets = args.command
101
+ .split("\n")
102
+ .map(line => PATCH_TARGET.exec(line)?.[1])
103
+ .filter(Boolean);
104
+ return targets.length ? targets : null;
105
+ }
106
+ return null;
107
+ }
108
+
109
+ /**
110
+ * Whether an unbound session's tool call only writes outside every repository.
111
+ * @param {Record<string, any>} input Hook event.
112
+ * @param {{projectRoot: string}} cfg Task configuration.
113
+ * @returns {boolean} True to admit it.
114
+ */
115
+ export function unboundWrite(input, cfg) {
116
+ const targets = writeTargets(input);
117
+ return (
118
+ targets !== null &&
119
+ targets.every(target => outsideEveryRepository(target, cfg.projectRoot))
120
+ );
121
+ }
122
+
123
+ /**
124
+ * The exact read command this installation admits with no work item bound.
125
+ * @param {Record<string, any>} cfg Task configuration.
126
+ * @returns {string|null} Command text with a placeholder ticket, or null.
127
+ */
128
+ function readCommand(cfg) {
129
+ const c = cfg.effective ?? {};
130
+ const script = /^[\w./@+-]+$/.test(owner)
131
+ ? owner
132
+ : `'${owner.replaceAll("'", "'\\''")}'`;
133
+ if (c.tracker === "linear" && c.linear?.teamKey)
134
+ return `node ${script} --tracker-intake-read --ref ${c.linear.teamKey}-<number> --read issue`;
135
+ if (c.tracker === "jira" && c.jira?.project)
136
+ return `node ${script} --tracker-intake-read --ref ${c.jira.project}-<number> --read issue`;
137
+ const repo = c.github && configuredIssueRepository(c.github);
138
+ if (repo && (!c.tracker || c.tracker === "github"))
139
+ return `gh issue view <number> --repo ${repo} --json ${issueFields}`;
140
+ return null;
141
+ }
142
+
143
+ /**
144
+ * The refusal for a session with no work item bound, in plain English.
145
+ * @param {Record<string, any>} cfg Task configuration.
146
+ * @returns {{allowed: false, code: string, action: string}} Refusal.
147
+ */
148
+ export function unboundRefusal(cfg) {
149
+ const read = readCommand(cfg);
150
+ const comments =
151
+ read && read.includes("--read issue")
152
+ ? " Use `--read comments` for its comments."
153
+ : "";
154
+ return {
155
+ allowed: false,
156
+ code: "work-item-unbound",
157
+ action: [
158
+ "No work item is bound to this checkout, so only reading is allowed.",
159
+ "Read files with the Read, Grep and Glob tools.",
160
+ read
161
+ ? `Read a ticket with exactly this command, with the ticket's number in place of <number>: ${read}.${comments}`
162
+ : "",
163
+ "A file written outside every git repository, such as a scratch or memory file, is allowed.",
164
+ "To change anything in this project, bind its ticket first with lisa-track.",
165
+ ]
166
+ .filter(Boolean)
167
+ .join(" "),
168
+ };
169
+ }
@@ -6,6 +6,14 @@ Apply `do-it-now` before creating work from incidental findings. Declining an ob
6
6
 
7
7
  The project tracker is the durable operator-facing record for project work. Every session that will produce a durable project outcome must establish exactly one live configured-tracker leaf before the first durable mutation. Durable outcomes include code, tests, configuration, documentation, committed research or plans, investigation findings, commits, and pull requests. Read-only questions, discussion, and repository orientation are exempt until they turn into durable work.
8
8
 
9
+ In a project with `.lisa.config.json`, the task-readiness guard enforces this. With no ticket bound, it refuses shell commands and project writes with `work-item-unbound`, and admits only:
10
+
11
+ - the Read, Grep and Glob tools;
12
+ - the fixed ticket read commands. The refusal names the exact one for that installation: `preflight-secrets.mjs --tracker-intake-read --ref <KEY> --read issue|comments` for Linear and Jira, `gh issue view <n> --repo <org>/<repo> --json …` for GitHub;
13
+ - a write that lands in no git repository, such as a scratch or memory file.
14
+
15
+ Answering a question about a ticket needs none of this. Never bind a ticket just to read one.
16
+
9
17
  ## Resolve, claim, bind
10
18
 
11
19
  Use `lisa-track` as the single entry point:
@@ -19,6 +19,8 @@ node /absolute/lisa-secrets-access/scripts/preflight-secrets.mjs --tracker-intak
19
19
  node /absolute/lisa-secrets-access/scripts/preflight-secrets.mjs --tracker-intake-read --ref PROJ-123 --read comments
20
20
  ```
21
21
 
22
+ The same two commands are the read for a session with no ticket bound, for example a question about an issue: the task-readiness guard admits them, and its `work-item-unbound` refusal names them with the installed path. Do not bind a ticket just to read one.
23
+
22
24
  The token route returns the full issue and remote links, and the comments command reads all pages in order. If the token is unavailable, the command can read the issue through an already authenticated `acli` session on the configured site. That route reports `remoteLinks: null` and returns comments only when the embedded page is complete. Use the Atlassian access owner's native Jira issue and remote-link reads against the configured cloud and issue key to fill missing data. Check the embedded comment total before treating native context as complete.
23
25
 
24
26
  ## Phase 1 — Resolve Context
@@ -25,6 +25,8 @@ node /absolute/lisa-secrets-access/scripts/preflight-secrets.mjs --tracker-intak
25
25
  node /absolute/lisa-secrets-access/scripts/preflight-secrets.mjs --tracker-intake-read --ref ENG-123 --read comments
26
26
  ```
27
27
 
28
+ The same two commands are the read for a session with no ticket bound, for example a question about an issue: the task-readiness guard admits them, and its `work-item-unbound` refusal names them with the installed path. Do not bind a ticket just to read one.
29
+
28
30
  The issue response includes the primary body, team, and related graph fields. The comments command returns the entire paginated comment list or fails. Fetch related issues in the configured team with the same command and their issue keys. If a graph field reports another page, record the context as incomplete until those related records can be read through the access owner.
29
31
 
30
32
  If the token route is unavailable, load `lisa-linear-access` and use its native Linear MCP fallback. List teams with the configured team key as `query`, verify the configured workspace and team, then read the issue by its key. Use the resulting issue identifier or UUID for the comment pages. This read-only path leaves the requirements header and access check to the normal task flow.
@@ -9,6 +9,7 @@ import { readTaskRequirements } from "./task-requirements.mjs";
9
9
  import { lifecycleEvents, resetNativeEvent } from "./task-native-lifecycle.mjs";
10
10
  import { intakeRead } from "./task-intake.mjs";
11
11
  import { nativeContext } from "./task-native-context.mjs";
12
+ import { unboundRefusal, unboundWrite } from "./task-unbound.mjs";
12
13
  import {
13
14
  linearIntakeRead,
14
15
  observeLinearIntake,
@@ -177,7 +178,8 @@ export function runTaskAction(argv = process.argv) {
177
178
  result = failure("requirements-stale");
178
179
  else if (hook && result.code === "no-active-task") {
179
180
  if (cfg.provenance?.status === "absent") return;
180
- result = failure("requirements-stale");
181
+ if (unboundWrite(input, cfg)) return;
182
+ result = unboundRefusal(cfg);
181
183
  } else if (hook && result.outcome === "NATIVE_OWNER_REQUIRED") {
182
184
  const decision = nativeAction(cfg, header, result, input);
183
185
  if (decision.allowed) result = { allowed: true, code: decision.code };
@@ -90,19 +90,29 @@ export function writeRequirementsContext(
90
90
  if (error.code !== "ENOENT") fail();
91
91
  initial = true;
92
92
  }
93
+ const freshBody =
94
+ typeof input.context_body === "string" &&
95
+ !input.context_body.startsWith(marker);
96
+ // Re-binding the checkout to another item leaves the previous item's
97
+ // context behind. With the binding already naming `ref`, that context
98
+ // belongs to no current work: a fresh body for `ref` replaces it, so the
99
+ // prepare step that follows a re-bind does not dead-end the session.
100
+ let replacing = false;
93
101
  if (initial) {
94
- if (
95
- typeof input.context_body !== "string" ||
96
- input.context_body.startsWith(marker)
97
- )
98
- fail();
102
+ if (!freshBody) fail();
99
103
  } else {
100
104
  try {
101
- if (realpathSync(path) !== path || input.context_body !== undefined)
102
- fail();
105
+ if (realpathSync(path) !== path) fail();
103
106
  } catch {
104
107
  fail();
105
108
  }
109
+ const previous = previousItem(readFileSync(path, "utf8"), marker);
110
+ replacing =
111
+ freshBody &&
112
+ binding?.ref === ref &&
113
+ previous !== null &&
114
+ previous !== ref;
115
+ if (input.context_body !== undefined && !replacing) fail();
106
116
  }
107
117
  const eas = join(cfg.projectRoot, ".easignore");
108
118
  if (
@@ -113,7 +123,8 @@ export function writeRequirementsContext(
113
123
  )
114
124
  fail();
115
125
  ensureIgnored(cfg.projectRoot);
116
- let body = initial ? input.context_body : readFileSync(path, "utf8");
126
+ let body =
127
+ initial || replacing ? input.context_body : readFileSync(path, "utf8");
117
128
  if (body.startsWith(marker)) {
118
129
  const end = body.indexOf("\n-->\n");
119
130
  if (end < 0) fail();
@@ -154,5 +165,25 @@ export function writeRequirementsContext(
154
165
  } finally {
155
166
  rmSync(staging, { recursive: true, force: true });
156
167
  }
157
- return { code: "requirements-prepared", body_preserved: true };
168
+ return { code: "requirements-prepared", body_preserved: !replacing };
169
+ }
170
+
171
+ /**
172
+ * The work item a prepared context names, or null when it names none.
173
+ * @param {string} current The context file's text.
174
+ * @param {string} marker The requirements header's opening line.
175
+ * @returns {string|null} The previous work item reference.
176
+ */
177
+ function previousItem(current, marker) {
178
+ if (!current.startsWith(marker)) return null;
179
+ const end = current.indexOf("\n-->\n");
180
+ if (end < 0) return null;
181
+ try {
182
+ const header = JSON.parse(current.slice(marker.length, end));
183
+ return typeof header?.work_item_ref === "string"
184
+ ? header.work_item_ref
185
+ : null;
186
+ } catch {
187
+ return null;
188
+ }
158
189
  }