greprag 5.79.0 → 5.82.0

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 (64) hide show
  1. package/dist/capture-manifest.js +2 -1
  2. package/dist/codex-fast-hook.js +6 -0
  3. package/dist/codex-steering.js +1 -1
  4. package/dist/commands/announce.js +97 -0
  5. package/dist/commands/app-model.js +0 -1
  6. package/dist/commands/arm-reminder.js +9 -7
  7. package/dist/commands/collision-check.js +7 -6
  8. package/dist/commands/corpus/client.js +13 -3
  9. package/dist/commands/delivery-reminder.js +35 -14
  10. package/dist/commands/deploy-gate.js +55 -0
  11. package/dist/commands/deploy-lock.js +100 -0
  12. package/dist/commands/deploy-record.js +145 -0
  13. package/dist/commands/deploy-verify.js +111 -0
  14. package/dist/commands/inbox-primer-reminder.js +5 -5
  15. package/dist/commands/inbox-watch.js +2 -4
  16. package/dist/commands/init.js +96 -1
  17. package/dist/commands/load.js +40 -0
  18. package/dist/commands/loadout-reminder.js +1 -1
  19. package/dist/commands/merge-guard.js +419 -0
  20. package/dist/commands/merge-lock.js +176 -0
  21. package/dist/commands/parity-reminder.js +53 -0
  22. package/dist/commands/persona-reminder.js +11 -0
  23. package/dist/commands/persona.js +50 -0
  24. package/dist/commands/procedure.js +77 -6
  25. package/dist/commands/reminder-registry.js +107 -3
  26. package/dist/commands/repodoc.js +433 -0
  27. package/dist/commands/search.js +149 -0
  28. package/dist/commands/skillgain.js +33 -25
  29. package/dist/delivery-lifecycle.js +16 -1
  30. package/dist/deploy-gate.js +355 -0
  31. package/dist/deploy-locks.js +339 -0
  32. package/dist/deploy-verify.js +209 -0
  33. package/dist/env-redaction.js +157 -0
  34. package/dist/harness-limits.js +17 -0
  35. package/dist/hook-runtime.js +11 -1
  36. package/dist/hook.js +229 -88
  37. package/dist/index.js +601 -567
  38. package/dist/inline-atom-episode.js +15 -7
  39. package/dist/inline-atom.js +8 -2
  40. package/dist/native-skill-adoption.js +11 -0
  41. package/dist/native-skill-mirror.js +8 -1
  42. package/dist/node-identity.bundle.js +1166 -0
  43. package/dist/opencode-plugin.bundle.js +307 -119
  44. package/dist/procedure-enabled.js +55 -0
  45. package/dist/procedure-runtime.js +6 -0
  46. package/dist/procedure-scope.js +190 -0
  47. package/dist/procedure-watch.js +29 -16
  48. package/dist/procedure.js +111 -5
  49. package/dist/project-anchor.js +1 -14
  50. package/dist/reminder-injector.js +11 -10
  51. package/dist/repodoc-client.js +296 -0
  52. package/dist/session-id.js +7 -8
  53. package/dist/skill-landing.js +57 -2
  54. package/dist/skill-mirror-client.js +14 -0
  55. package/dist/skill-mirror-files.js +18 -0
  56. package/package.json +2 -2
  57. package/scripts/bundle-node-identity.mjs +47 -0
  58. package/skill/templates/chip-spawn.md +7 -1
  59. package/skill/templates/delivery.md +105 -0
  60. package/skill/templates/prompt-audit.md +196 -0
  61. package/skill/templates/skill-change.md +25 -2
  62. package/dist/assistant-doctrine.js +0 -85
  63. package/dist/commands/assistant-reminder.js +0 -19
  64. package/dist/commands/assistant.js +0 -95
@@ -185,6 +185,14 @@ function openIndex(episodes, atom) {
185
185
  }
186
186
  return -1;
187
187
  }
188
+ /** Replay outcomes DEMOTE only. A `worked` replay means the agent complied with
189
+ * the replayed instruction — it is not evidence the instruction is TRUE, and a
190
+ * wrong-but-followable claim produces `worked` more reliably than a right one.
191
+ * Promoting on compliance manufactured authority the atom never earned: the
192
+ * Persona atom asserting a 1650-byte budget graded `worked` twice, reached
193
+ * `confirmed`, and kept steering sessions to a third of the real limit until a
194
+ * human said so out loud. Only `failed` — something actually went wrong — moves
195
+ * a schema. adr: adr/capture-episodes.md */
188
196
  function applyReplayOutcomes(projectId, observations) {
189
197
  let store = (0, inline_atom_1.readInlineAtomSchemaStore)(projectId);
190
198
  let changed = false;
@@ -196,15 +204,15 @@ function applyReplayOutcomes(projectId, observations) {
196
204
  const schema = store.schemas.find(s => s.atom.toLowerCase() === observation.atom.toLowerCase());
197
205
  if (!schema)
198
206
  continue;
199
- const status = observation.replay === 'worked' ? 'confirmed' : 'stale';
200
- if (schema.status === status)
207
+ if (observation.replay === 'worked') {
208
+ worked++;
209
+ continue;
210
+ }
211
+ if (schema.status === 'stale')
201
212
  continue;
202
- store = (0, inline_atom_1.upsertInlineAtomSchema)(store, { ...schema, status });
213
+ store = (0, inline_atom_1.upsertInlineAtomSchema)(store, { ...schema, status: 'stale' });
203
214
  changed = true;
204
- if (observation.replay === 'worked')
205
- worked++;
206
- else
207
- failed++;
215
+ failed++;
208
216
  }
209
217
  if (changed)
210
218
  (0, inline_atom_1.writeInlineAtomSchemaStore)(projectId, store);
@@ -204,12 +204,18 @@ function matchInlineAtomSchemas(prompt, store) {
204
204
  .filter(s => s.status !== 'stale')
205
205
  .filter(s => s.triggers.some(t => triggerHits(prompt, t)));
206
206
  }
207
+ /** No status badge. A schema's status is lifecycle bookkeeping, never a truth
208
+ * claim: printing `(confirmed)` next to a recalled sentence told the agent the
209
+ * sentence had been verified when nothing had ever checked it against the code
210
+ * it describes. The header says what these lines actually are — recollection,
211
+ * not fact — so a quoted number, limit or path gets checked before it steers.
212
+ * adr: adr/capture-episodes.md */
207
213
  function buildInlineAtomSchemaInjection(schemas) {
208
214
  if (schemas.length === 0)
209
215
  return null;
210
216
  return [
211
- '[Inline-Atom schema replay]',
212
- ...schemas.slice(0, MAX_FRICTIONS).map(s => `- \`${s.atom}\` (${s.status}): ${s.injection}`),
217
+ '[Inline-Atom schema replay — recalled from earlier sessions, never re-checked against current code. Verify any number, limit, or path it quotes before relying on it.]',
218
+ ...schemas.slice(0, MAX_FRICTIONS).map(s => `- \`${s.atom}\`: ${s.injection}`),
213
219
  ].join('\n');
214
220
  }
215
221
  function buildInlineAtomFrictionInjection(records) {
@@ -192,6 +192,17 @@ function planNativeSkillAdoption(params) {
192
192
  plan.skipped.push({ ...root, skillName, reason: 'invalid or oversized markdown payload' });
193
193
  continue;
194
194
  }
195
+ // A directory greprag already wrote an adapter into is not an unmanaged
196
+ // native skill, whatever the local state file says (it is per-root and
197
+ // per-machine, so a fresh checkout or a lost state file makes every
198
+ // adapter look adoptable). Adopting one would upload the launcher as
199
+ // canon and erase the real body. Same rule as the shadow upload path.
200
+ // adr: adr/skill-adapter-never-canon.md
201
+ const main = files.find(file => file.path === 'SKILL.md');
202
+ if (main && (0, skill_mirror_files_1.isGeneratedSkillAdapter)(main.content)) {
203
+ plan.skipped.push({ ...root, skillName, reason: 'generated adapter is never a mirror source' });
204
+ continue;
205
+ }
195
206
  plan.candidates.push({ ...root, skillName, files, sourceHash: (0, skill_mirror_files_1.computeSkillFileHash)(files) });
196
207
  }
197
208
  }
@@ -51,7 +51,14 @@ const skill_mirror_files_1 = require("./skill-mirror-files");
51
51
  const SKILL_NAME_RE = /^[A-Za-z0-9._-]{1,64}$/;
52
52
  const NATIVE_SKILL_NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
53
53
  const PROJECT_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
54
- const NATIVE_DESCRIPTION_MAX_CHARS = 1024;
54
+ // A skill's description is what the harness matches on to decide whether the
55
+ // skill fires, so condensing it costs trigger coverage. 1024 was an arbitrary
56
+ // self-imposed bound, not a harness limit — Claude Code carries far longer
57
+ // descriptions fine. It silently truncated 7 skills on 2026-09-04 (longest
58
+ // 1598 chars), dropping their trailing trigger phrases. 2500 clears every
59
+ // current skill with headroom; the condenser stays as the backstop for a
60
+ // genuinely runaway description.
61
+ const NATIVE_DESCRIPTION_MAX_CHARS = 2500;
55
62
  const STATE_FILE = '.greprag-mirror.json';
56
63
  exports.NATIVE_SKILL_ADAPTER_PLATFORMS = ['codex', 'opencode'];
57
64
  function nativeSkillMirrorEnabled(platform) {