simt-dev 0.2.1 → 0.2.2

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 (61) hide show
  1. package/CHANGELOG.md +202 -0
  2. package/docs/decisions/ADR-064-the-context-meter-counts-what-the-tool-wrote.md +107 -0
  3. package/docs/decisions/ADR-065-a-pack-is-one-shared-rule-set-pinned-by-digest.md +97 -0
  4. package/docs/decisions/ADR-066-a-monorepo-projects-once-per-package.md +115 -0
  5. package/docs/decisions/ADR-067-which-harnesses-read-agents-md-is-a-column.md +110 -0
  6. package/docs/decisions/ADR-068-the-mcp-revision-list-cites-what-was-read.md +111 -0
  7. package/docs/decisions/ADR-069-the-conformance-lint-checks-the-published-specification.md +90 -0
  8. package/docs/decisions/ADR-070-the-json-payload-carries-its-own-version.md +91 -0
  9. package/docs/decisions/ADR-071-a-rule-that-can-be-narrowed-is-written-narrow.md +106 -0
  10. package/docs/decisions/ADR-072-the-budget-is-a-declaration-beside-the-gates.md +104 -0
  11. package/docs/decisions/ADR-073-a-kernel-is-a-smaller-projection-the-repository-asks-for.md +92 -0
  12. package/package.json +1 -1
  13. package/rules/core.md +1 -0
  14. package/rules/stacks/android.md +2 -0
  15. package/rules/stacks/cloudflare-workers.md +2 -0
  16. package/rules/stacks/connectiq.md +1 -0
  17. package/rules/stacks/container.md +2 -0
  18. package/rules/stacks/dart.md +2 -0
  19. package/rules/stacks/deno.md +2 -0
  20. package/rules/stacks/dotnet.md +2 -0
  21. package/rules/stacks/elixir.md +2 -0
  22. package/rules/stacks/go.md +2 -0
  23. package/rules/stacks/jvm.md +2 -0
  24. package/rules/stacks/node.md +2 -0
  25. package/rules/stacks/python.md +2 -0
  26. package/rules/stacks/react-native.md +2 -0
  27. package/rules/stacks/react-web.md +2 -0
  28. package/rules/stacks/ruby.md +2 -0
  29. package/rules/stacks/rust.md +2 -0
  30. package/rules/stacks/swift.md +2 -0
  31. package/rules/stacks/typescript.md +2 -0
  32. package/rules/stacks/uv.md +2 -0
  33. package/src/argv.mjs +19 -0
  34. package/src/commands/compare.mjs +15 -0
  35. package/src/commands/graph.mjs +45 -21
  36. package/src/commands/harness.mjs +150 -0
  37. package/src/commands/help.mjs +15 -1
  38. package/src/commands/index.mjs +43 -25
  39. package/src/commands/init.mjs +12 -8
  40. package/src/commands/mcp.mjs +20 -5
  41. package/src/commands/rules.mjs +42 -57
  42. package/src/commands/skills.mjs +67 -92
  43. package/src/commands/skillsinstall.mjs +17 -2
  44. package/src/commands/sync.mjs +62 -6
  45. package/src/commands/tokens.mjs +138 -0
  46. package/src/compare/row.mjs +73 -2
  47. package/src/graph/spec.mjs +227 -0
  48. package/src/graph/speccheck.mjs +68 -0
  49. package/src/hooks/dispatcher.mjs +35 -3
  50. package/src/mcp/schema.mjs +139 -0
  51. package/src/mcp/server.mjs +197 -20
  52. package/src/mcp/tools.mjs +288 -1
  53. package/src/measure/context.mjs +371 -0
  54. package/src/monorepo.mjs +339 -0
  55. package/src/output/index.mjs +78 -2
  56. package/src/packs.mjs +182 -0
  57. package/src/projection/manifest.mjs +88 -0
  58. package/src/projection/project.mjs +140 -9
  59. package/src/projection/rules.mjs +288 -20
  60. package/src/projection/surfaces.mjs +133 -15
  61. package/src/projection/targets.mjs +37 -0
@@ -136,6 +136,43 @@ export async function ruleTargets(root, rule, body, sha, resolved, notes) {
136
136
  return { targets };
137
137
  }
138
138
 
139
+ /**
140
+ * Per-rule files for the profiles that left the region, for the surfaces that can
141
+ * narrow them.
142
+ *
143
+ * A scoped profile is an ordinary rule with a `scope` on it, and that is the whole
144
+ * reason this is a thin wrapper over {@link ruleTargets} rather than a second
145
+ * construction: the byte-level concerns — frontmatter re-derived per surface, the
146
+ * region injected between the markers, the retired-prose note — are already decided
147
+ * there and must not be decided twice. A second implementation would drift from the
148
+ * first and the gate would report drift on a clean tree, which is the failure this
149
+ * module exists to prevent.
150
+ *
151
+ * The one thing it adds is the skip: a surface that folds the region carries the whole
152
+ * region already, so a scoped file is the duplication S12 removed — UNLESS the profile
153
+ * actually left the region, which is `narrowing`, the caller's answer, and which means
154
+ * the reader would otherwise get nothing.
155
+ */
156
+ export async function scopedTargets(root, rules, sha, resolved, notes) {
157
+ const targets = [];
158
+ for (const rule of rules) {
159
+ // `alwaysApply: false` is what asks the surface to attach the file on the patterns
160
+ // rather than always. Cursor's documented reading of no description plus no globs is
161
+ // a manual @-mention, so a scoped rule carries its scope and the description it
162
+ // already had.
163
+ // `target` is what `ruleName` reads, and a stack profile has none: it is a plain
164
+ // `python.md`, not an `.mdc` in the rules directory. Without it the file is named
165
+ // `null.mdc`, which is exactly what the first version of this did.
166
+ const scoped = {
167
+ ...rule,
168
+ target: rule.target ?? `${rule.id}.mdc`,
169
+ alwaysApply: false,
170
+ scope: rule.scope,
171
+ };
172
+ targets.push(...(await ruleTargets(root, scoped, rule.body, sha, resolved, notes)).targets);
173
+ }
174
+ return { targets };
175
+ }
139
176
 
140
177
  /**
141
178
  * Pointer targets: `CLAUDE.md` and `GEMINI.md` as symlinks to `AGENTS.md`.