@sleepy_panda_srl/portulan 0.1.3 → 0.3.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 (89) hide show
  1. package/README.md +7 -6
  2. package/cli/README.md +145 -358
  3. package/cli/advisory.mjs +354 -0
  4. package/cli/comments.mjs +932 -0
  5. package/cli/compile.mjs +1719 -1699
  6. package/cli/context.mjs +883 -0
  7. package/cli/control-chars.mjs +12 -301
  8. package/cli/discover.mjs +17 -574
  9. package/cli/doctor.mjs +269 -1080
  10. package/cli/drills.mjs +92 -504
  11. package/cli/feedback.mjs +16 -237
  12. package/cli/finish.mjs +437 -0
  13. package/cli/form.mjs +644 -0
  14. package/cli/fuzz-shell.mjs +20 -305
  15. package/cli/gate.mjs +7 -199
  16. package/cli/goldens.mjs +26 -184
  17. package/cli/index.mjs +305 -655
  18. package/cli/init.mjs +243 -566
  19. package/cli/inside.mjs +3 -28
  20. package/cli/instructions.mjs +829 -0
  21. package/cli/ledger.mjs +882 -0
  22. package/cli/librarian.mjs +135 -599
  23. package/cli/manifest.mjs +2 -39
  24. package/cli/mutants.mjs +9 -170
  25. package/cli/new.mjs +12 -243
  26. package/cli/pack-identity.mjs +5 -74
  27. package/cli/pack-version.mjs +13 -255
  28. package/cli/plugin-lint.mjs +42 -658
  29. package/cli/portulan.mjs +6 -125
  30. package/cli/recipe-set.mjs +15 -245
  31. package/cli/release-eval.mjs +28 -348
  32. package/cli/review-meter.mjs +29 -265
  33. package/cli/rule-carriers.mjs +12 -175
  34. package/cli/sessions.mjs +82 -0
  35. package/cli/skill-goldens.mjs +10 -176
  36. package/cli/skills-set.mjs +12 -414
  37. package/cli/stop-gate.mjs +83 -514
  38. package/cli/symbols.mjs +1132 -0
  39. package/cli/telemetry.mjs +82 -505
  40. package/cli/upgrade.mjs +171 -314
  41. package/cli/vendor.mjs +146 -476
  42. package/cli/version-carriers.mjs +8 -86
  43. package/core/README.md +1 -1
  44. package/core/engine.md +3 -9
  45. package/core/operating/autonomy.md +1 -1
  46. package/core/operating/context.md +258 -0
  47. package/core/operating/evolution.md +3 -3
  48. package/core/operating/loop.md +13 -20
  49. package/core/operating/memory.md +12 -3
  50. package/core/operating/sessions.md +100 -0
  51. package/core/personas/README.md +33 -0
  52. package/core/personas/librarian.md +2 -2
  53. package/core/skills/clarify/SKILL.md +1 -1
  54. package/core/skills/consolidate/SKILL.md +5 -3
  55. package/core/templates/handoff.md +28 -15
  56. package/core/templates/memory-entry.md +1 -0
  57. package/evals/README.md +271 -845
  58. package/evals/releases/0.2.0.json +146 -0
  59. package/evals/releases/0.2.0.md +67 -0
  60. package/evals/releases/0.3.0.json +150 -0
  61. package/evals/releases/0.3.0.md +68 -0
  62. package/evals/releases/README.md +3 -3
  63. package/package.json +5 -2
  64. package/packs/.claude-plugin/plugin.json +2 -1
  65. package/packs/README.md +7 -4
  66. package/packs/rituals/checkpoints/README.md +1 -1
  67. package/packs/tools/README.md +8 -8
  68. package/packs/tools/github/verify/actions-pinned.sh +10 -55
  69. package/packs/tools/local-llm/README.md +136 -0
  70. package/packs/tools/local-llm/pack.json +32 -0
  71. package/packs/tools/local-llm/personas/local-worker.md +44 -0
  72. package/packs/tools/local-llm/runner/local-llm.mjs +1665 -0
  73. package/packs/tools/local-llm/skills/delegate-local/SKILL.md +64 -0
  74. package/packs/tools/local-llm/verify/README.md +18 -0
  75. package/spec/README.md +113 -6
  76. package/spec/migrations/0001-repository-declares-its-tree.mjs +1 -26
  77. package/spec/migrations/0002-bundle-fallback-path.mjs +13 -74
  78. package/spec/migrations/0003-handoff-index-not-kept.mjs +66 -0
  79. package/spec/migrations/0004-changelog-fragments.mjs +53 -0
  80. package/spec/migrations/0005-session-log-retired.mjs +69 -0
  81. package/spec/migrations/0006-boot-card.mjs +77 -0
  82. package/spec/migrations/0007-guidance-compiled.mjs +31 -0
  83. package/spec/migrations/0008-card-reading.mjs +55 -0
  84. package/spec/migrations/0009-instruction-sections-on-read.mjs +60 -0
  85. package/spec/migrations/0010-comment-rail.mjs +57 -0
  86. package/spec/migrations/README.md +45 -10
  87. package/spec/pack.schema.json +1 -1
  88. package/spec/slots.md +343 -27
  89. package/spec/workspace.schema.json +145 -4
package/cli/inside.mjs CHANGED
@@ -1,38 +1,13 @@
1
1
  // Is one path inside another? One predicate, one file, no dependencies.
2
- //
3
- // **It lives alone because two large modules need it and must not import each other.** It began in
4
- // `./index.mjs`, which `./doctor.mjs` imports; when `./compile.mjs` needed it too, importing it from
5
- // there would have closed a cycle — `index.mjs` already imports `resolvePack`/`rootPlan` from
6
- // `compile.mjs`. This repository has paid for a cycle once already: `../docs/plan.md`'s session log
7
- // records **an import cycle exiting 13 in silence**, and three modules (`./plugin-lint.mjs:1369`,
8
- // `./skills-set.mjs:48` and `:114`) carry comments explaining that they chose their import direction
9
- // to avoid making one. Copying the predicate instead was the other option and is the one its own
10
- // docblock forbids: two copies of this rule drifted into the identical defect before either shipped.
11
- //
12
- // So the rule keeps one implementation and gains no edges. `./index.mjs` re-exports it, so every
13
- // existing importer is untouched.
14
- //
15
- // Found by Copilot on the change that closed #264, which had reached for the `index.mjs` export.
16
2
 
17
3
  import path from "node:path";
18
4
 
19
- /**
20
- * Is `child` inside `parent`?
21
- *
22
- * **The obvious spelling — `!path.relative(parent, child).startsWith("..")` — is wrong, and it fails
23
- * OPEN.** A name beginning with `..` is an ordinary filename, not a traversal: `path.relative` of
24
- * `memory/..index.md` against `memory/` is `..index.md`, which `startsWith("..")` calls *outside*.
25
- * Measured end to end before this was written — an index declared at `memory/..index.md` was written
26
- * into the store, reported `ok`, and `doctor` then counted it as a second record. That is the ninth
27
- * fail-open found in this repository's scaffolding, and the first one written by the change that
28
- * cites the class; `recordedOrigin` in `./compile.mjs` was the second, which is why this moved here.
29
- *
30
- * Only `..` exactly, or `..` followed by a separator, means outside. An absolute result means the two
31
- * paths share no root and cannot contain one another. A path is inside itself.
32
- */
5
+ /** True when `child` is `parent` itself or lies under it. */
33
6
  export function isInside(parent, child) {
34
7
  const rel = path.relative(parent, child);
35
8
  if (rel === "") return true;
9
+ // Absolute when the two share no root, as two Windows drives do.
36
10
  if (path.isAbsolute(rel)) return false;
11
+ // Not `startsWith("..")`: a name such as `..index.md` is an ordinary file, not a traversal.
37
12
  return rel !== ".." && !rel.startsWith(`..${path.sep}`);
38
13
  }