@sleepy_panda_srl/portulan 0.1.2 → 0.2.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 (81) hide show
  1. package/README.md +7 -6
  2. package/cli/README.md +142 -291
  3. package/cli/advisory.mjs +354 -0
  4. package/cli/comments.mjs +932 -0
  5. package/cli/compile.mjs +1443 -1210
  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 +225 -1071
  10. package/cli/drills.mjs +1107 -0
  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 +595 -0
  15. package/cli/gate.mjs +7 -198
  16. package/cli/goldens.mjs +311 -0
  17. package/cli/index.mjs +305 -655
  18. package/cli/init.mjs +244 -564
  19. package/cli/inside.mjs +3 -28
  20. package/cli/instructions.mjs +829 -0
  21. package/cli/ledger.mjs +778 -0
  22. package/cli/librarian.mjs +135 -599
  23. package/cli/manifest.mjs +2 -39
  24. package/cli/mutants.mjs +764 -0
  25. package/cli/new.mjs +12 -243
  26. package/cli/pack-identity.mjs +6 -68
  27. package/cli/pack-version.mjs +13 -248
  28. package/cli/plugin-lint.mjs +42 -658
  29. package/cli/portulan.mjs +5 -124
  30. package/cli/recipe-set.mjs +16 -240
  31. package/cli/release-eval.mjs +748 -0
  32. package/cli/review-meter.mjs +500 -0
  33. package/cli/rule-carriers.mjs +12 -175
  34. package/cli/sessions.mjs +82 -0
  35. package/cli/skill-goldens.mjs +424 -0
  36. package/cli/skills-set.mjs +12 -414
  37. package/cli/stop-gate.mjs +126 -454
  38. package/cli/symbols.mjs +1132 -0
  39. package/cli/telemetry.mjs +582 -0
  40. package/cli/upgrade.mjs +171 -314
  41. package/cli/vendor.mjs +146 -476
  42. package/cli/version-carriers.mjs +9 -74
  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 +183 -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/librarian.md +2 -2
  52. package/core/skills/consolidate/SKILL.md +4 -2
  53. package/core/templates/gate-policy.md +27 -8
  54. package/core/templates/handoff.md +28 -15
  55. package/core/templates/memory-entry.md +1 -0
  56. package/evals/README.md +320 -0
  57. package/evals/releases/0.1.3.json +134 -0
  58. package/evals/releases/0.1.3.md +64 -0
  59. package/evals/releases/0.2.0.json +146 -0
  60. package/evals/releases/0.2.0.md +67 -0
  61. package/evals/releases/README.md +32 -0
  62. package/package.json +9 -2
  63. package/packs/rituals/checkpoints/README.md +9 -2
  64. package/packs/rituals/checkpoints/pack.json +1 -1
  65. package/packs/rituals/checkpoints/skills/pre-commit/SKILL.md +32 -2
  66. package/packs/tools/github/verify/actions-pinned.sh +10 -55
  67. package/spec/README.md +112 -6
  68. package/spec/migrations/0001-repository-declares-its-tree.mjs +1 -26
  69. package/spec/migrations/0002-bundle-fallback-path.mjs +13 -74
  70. package/spec/migrations/0003-handoff-index-not-kept.mjs +66 -0
  71. package/spec/migrations/0004-changelog-fragments.mjs +53 -0
  72. package/spec/migrations/0005-session-log-retired.mjs +69 -0
  73. package/spec/migrations/0006-boot-card.mjs +77 -0
  74. package/spec/migrations/0007-guidance-compiled.mjs +31 -0
  75. package/spec/migrations/0008-card-reading.mjs +55 -0
  76. package/spec/migrations/0009-instruction-sections-on-read.mjs +60 -0
  77. package/spec/migrations/0010-comment-rail.mjs +57 -0
  78. package/spec/migrations/README.md +45 -10
  79. package/spec/pack.schema.json +1 -1
  80. package/spec/slots.md +359 -23
  81. 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
  }