@vib795/agent-memory 0.6.4 → 0.6.5

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.
package/README.md CHANGED
@@ -427,15 +427,31 @@ GitHub, and it is the path to use behind a proxy that blocks or quarantines npm:
427
427
 
428
428
  ```bash
429
429
  git clone https://github.com/vib795/agent-memory.git
430
- npm install -g ./agent-memory
430
+ cd agent-memory && npm pack
431
+ npm install -g ./vib795-agent-memory-*.tgz
431
432
  agent-memory setup
432
433
  ```
433
434
 
434
- **Do not install from the git URL directly.** `npm install -g <git-url>` does not
435
+ **Pack first; do not install the directory.** `npm install -g ./agent-memory` looks
436
+ equivalent and is not: npm links the global install to that folder rather than copying
437
+ it, which shows up as an arrow in `npm list -g`:
438
+
439
+ ```
440
+ `-- @vib795/agent-memory@0.6.5 -> .\..\..\..\agent-memory
441
+ ```
442
+
443
+ Move or delete the clone afterwards and the global install points at nothing — the same
444
+ breakage as the git-URL case below, arriving later and harder to trace. Installing a
445
+ packed tarball copies, so the clone becomes disposable. Verified on npm 11.x.
446
+
447
+ **Do not install from the git URL directly either.** `npm install -g <git-url>` does not
435
448
  work for this package: npm resolves a git install through
436
449
  `~/.npm/_cacache/tmp/git-clone*` and then removes that directory, leaving the global
437
- install pointing at a path that no longer exists. Cloning first avoids npm's git
438
- handling entirely. Verified on npm 11.18.
450
+ install pointing at a path that no longer exists. Verified on npm 11.18.
451
+
452
+ **And run the installed binary, not the checkout.** Skill links resolve relative to the
453
+ code that creates them, so `npm run setup` inside a clone aims every link at that clone.
454
+ Use `agent-memory setup`, which runs the copy npm installed.
439
455
 
440
456
  Every release is mirrored to **GitHub Packages**. Treat that as redundancy rather
441
457
  than a second front door: GitHub Packages requires authentication even for public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vib795/agent-memory",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Durable cross-repo knowledge graph for GitHub Copilot and Claude Code. Markdown source of truth, disposable SQLite index, zero runtime dependencies.",
5
5
  "keywords": [
6
6
  "github-copilot",
@@ -129,6 +129,12 @@ repos:
129
129
  agent: copilot | claude-code
130
130
  ---
131
131
 
132
+ > **If the repository you are reading this in is not listed under `repos:` above, you are
133
+ > replicating this work, not continuing it.** Follow Execution protocol, re-derive every
134
+ > path, branch name and version from the repository you are actually in, and read Next
135
+ > action as a record of what happened elsewhere rather than as an instruction. Do not open
136
+ > the repository this was written in.
137
+
132
138
  ## Orientation
133
139
 
134
140
  3 to 5 sentences. What this thread is trying to accomplish and where it stands.
@@ -193,7 +199,9 @@ These separate a useful handoff from a readable paragraph that still leaves ques
193
199
  3. Never quote or paraphrase the transcript. Record conclusions, not the path to them.
194
200
  4. Anchor claims to a file path or a decision number. "We refactored the service
195
201
  layer" is a failure. "`src/services/order.ts:42` now returns `Result<T>` instead
196
- of throwing" is not.
202
+ of throwing" is not. When the thread spans more than one repository, name the repo
203
+ alongside the path: an unqualified path in a two-repo thread is a path the reader
204
+ goes looking for in the wrong tree, and finding it there is worse than not finding it.
197
205
  5. Record only what the conversation actually established. Prefix anything you
198
206
  inferred with `inferred:` so the next agent knows to verify it.
199
207
  6. Never inline a diff or a patch. List changed files with one line each.
@@ -296,8 +304,15 @@ request, which is the only reason this step belongs here rather than in its own
296
304
  - Zero durable knowledge is a valid outcome. Writing nothing beats writing noise.
297
305
  <!-- extraction-rules:end -->
298
306
 
299
- Your Decisions table and Constraints section are usually already the durable part.
300
- The Current task state section never is.
307
+ Your Decisions table, Constraints section and **Execution protocol** are usually already
308
+ the durable part. Write the protocol as a `convention`: it is the section a second
309
+ repository actually needs, and the one most easily lost, because a sequence of steps
310
+ reads like status even when it describes how every run of this kind is done. A handoff
311
+ that records the protocol while the graph does not still leaves the next repository
312
+ guessing — the handoff is read once, by whoever was handed the path, and the graph is
313
+ what `/recall` reaches for afterwards.
314
+
315
+ The Current task state section never is durable.
301
316
 
302
317
  ### Write it (ONE terminal call)
303
318
 
@@ -62,6 +62,11 @@ and what a regex does badly.
62
62
  - Pick 1 to 3 ids. More than 3 means the question is really several questions.
63
63
  - Always include a `constraint` that touches the subject, even when the user did not
64
64
  ask about limits. Constraints are what stop an approach that cannot ship.
65
+ - When the question is about **doing** the work rather than understanding it, also
66
+ include the `convention` that governs how that kind of work is executed. A constraint
67
+ tells you which steps are forbidden; only a procedure tells you what order the allowed
68
+ ones go in. Branch choreography and deploy ordering live here, and they are what a
69
+ second repository gets wrong when nobody surfaces them.
65
70
  - Nothing in the tree looks relevant → go to Step 4.
66
71
 
67
72
  ---
package/src/cli.js CHANGED
@@ -15,7 +15,8 @@ import { compact, maybeCompact } from './compact.js';
15
15
  import { staleness, currentRepo, reviewCandidates, captureGap } from './staleness.js';
16
16
  import { setup as runSetup, unlinkSkills, danglingSkillLinks, SKILLS } from './setup.js';
17
17
  import { detectTargets, installableTargets } from './targets.js';
18
- import { join, dirname } from 'node:path';
18
+ import { join, dirname, resolve, sep } from 'node:path';
19
+ import { fileURLToPath } from 'node:url';
19
20
  import { atomicWrite } from './atomic.js';
20
21
  import { redactNodeForExport, buildReceipt, renderReceipt } from './pii.js';
21
22
 
@@ -29,6 +30,41 @@ import { redactNodeForExport, buildReceipt, renderReceipt } from './pii.js';
29
30
 
30
31
  const MIN_NODE = [22, 5];
31
32
 
33
+ /**
34
+ * Where this process is actually running from, and what version it is.
35
+ *
36
+ * "What am I running" is the first question in every install problem and used to need
37
+ * `npm list -g` to answer, which reports what npm believes rather than what is on PATH.
38
+ * These read the package next to the running code, so they answer for the copy that
39
+ * will actually execute.
40
+ */
41
+ function packageRoot() {
42
+ return resolve(dirname(fileURLToPath(import.meta.url)), '..');
43
+ }
44
+
45
+ function installedVersion() {
46
+ try {
47
+ return JSON.parse(readFileSync(join(packageRoot(), 'package.json'), 'utf8')).version;
48
+ } catch {
49
+ return 'unknown';
50
+ }
51
+ }
52
+
53
+ /**
54
+ * Whether the running code lives outside any `node_modules` tree.
55
+ *
56
+ * `npm install -g <folder>` links rather than copies, so a global install can be a
57
+ * pointer at a checkout the user will eventually tidy away — and skill links, which
58
+ * resolve relative to this file, follow it there. Node resolves symlinks before it sets
59
+ * `import.meta.url`, so the link itself is already invisible from in here; what stays
60
+ * visible, and is the thing that actually matters, is that the code is not sitting in an
61
+ * installed package. Running from a working copy is legitimate, so this reports the
62
+ * condition rather than failing on it.
63
+ */
64
+ function runningFromWorkingCopy() {
65
+ return !packageRoot().split(sep).includes('node_modules');
66
+ }
67
+
32
68
  function parseArgs(argv) {
33
69
  const opts = { _: [] };
34
70
  for (let i = 0; i < argv.length; i++) {
@@ -93,6 +129,8 @@ const USAGE = `agent-memory — durable cross-repo knowledge for coding agents
93
129
  engagement [show|list|use <name>] which client store this window writes to
94
130
  [purge <name> --yes] delete one engagement's store entirely
95
131
 
132
+ --version this version, and the path it runs from
133
+
96
134
  Add --json to any command for machine-readable output.
97
135
  Engagement: ${ENGAGEMENT.name} (${ENGAGEMENT.source})
98
136
  Store: ${paths.root}`;
@@ -460,6 +498,25 @@ function cmdDoctor() {
460
498
  // reading it against the wrong client is the mistake this is here to prevent.
461
499
  add('engagement', true, `${ENGAGEMENT.name} (${ENGAGEMENT.source})`);
462
500
 
501
+ // Second, because "which version is this" preceded every other question in the one
502
+ // install failure this tool has actually been debugged through, and answering it
503
+ // needed a separate npm command that reports what npm believes rather than what ran.
504
+ add('version', true, `${installedVersion()} at ${packageRoot()}`);
505
+
506
+ // Skill links point at whatever copy of the code creates them. When that copy is a
507
+ // working directory rather than an installed package, deleting the directory dangles
508
+ // every link at once — which is exactly how this tool's own skill links were lost.
509
+ // Reported, not failed: running from a checkout is a normal thing to do deliberately.
510
+ add(
511
+ 'runs from an installed package',
512
+ true,
513
+ runningFromWorkingCopy()
514
+ ? `no — working copy at ${packageRoot()}; skill links will point here, so moving or ` +
515
+ 'deleting it breaks them. For a durable install: `npm pack` then ' +
516
+ '`npm install -g <tgz>`, and re-run setup.'
517
+ : 'yes',
518
+ );
519
+
463
520
  add('node version', nodeVersionOk(), `${process.versions.node} (need >= ${MIN_NODE.join('.')})`);
464
521
  if (!nodeVersionOk()) {
465
522
  return {
@@ -933,6 +990,12 @@ function main(argv) {
933
990
  process.stdout.write(`${USAGE}\n`);
934
991
  return 0;
935
992
  }
993
+ if (cmd === '--version' || cmd === '-v' || cmd === 'version') {
994
+ // Prints the path as well as the number. A version alone cannot tell you that the
995
+ // binary on PATH belongs to a different install than the one you just upgraded.
996
+ process.stdout.write(`${installedVersion()}\n${packageRoot()}\n`);
997
+ return 0;
998
+ }
936
999
  const fn = COMMANDS[cmd];
937
1000
  if (!fn) {
938
1001
  process.stderr.write(`Unknown command ${JSON.stringify(cmd)}.\n\n${USAGE}\n`);