@karmaniverous/stan-core 0.4.0 → 0.4.1
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/dist/cjs/index.js +1 -1
- package/dist/mjs/index.js +1 -1
- package/dist/stan.system.md +49 -0
- package/package.json +1 -1
package/dist/stan.system.md
CHANGED
|
@@ -801,6 +801,55 @@ diff --git a/new/path/to/file/a.ts b/new/path/to/file/a.ts
|
|
|
801
801
|
- When attaching artifacts for chat, prefer attaching `<stanPath>/output/archive.tar` (and `<stanPath>/output/archive.diff.tar` when present). If `--combine` was not used, you may also attach the text outputs individually.
|
|
802
802
|
- Important: Inside any attached archive, contextual files are located in the directory matching the `stanPath` key from `stan.config.*` (default `.stan`). The bootloader resolves this automatically.
|
|
803
803
|
|
|
804
|
+
# Facet‑aware editing guard (think beyond the next turn)
|
|
805
|
+
|
|
806
|
+
Purpose
|
|
807
|
+
- Prevent proposing content patches for files that are absent from the attached archives because a facet is inactive this run (overlay enabled).
|
|
808
|
+
- Preserve integrity‑first intake while keeping velocity high: when a target is hidden by the current view, enable the facet now and deliver the edits next turn.
|
|
809
|
+
|
|
810
|
+
Inputs to read first (when present)
|
|
811
|
+
- `<stanPath>/system/.docs.meta.json` — overlay record for this run:
|
|
812
|
+
- `overlay.enabled: boolean`
|
|
813
|
+
- `overlay.effective: Record<facet, boolean>` (true = active)
|
|
814
|
+
- `<stanPath>/system/facet.meta.json` — durable facet definitions:
|
|
815
|
+
- `name → { exclude: string[]; include: string[] }`
|
|
816
|
+
- exclude lists define facetized subtrees; include lists are anchors (always kept)
|
|
817
|
+
|
|
818
|
+
Guardrail (hard rule)
|
|
819
|
+
- If `overlay.enabled === true` and a target path falls under any facet whose `overlay.effective[facet] === false` (inactive this run), do NOT emit a content Patch for that target in this turn.
|
|
820
|
+
- Instead:
|
|
821
|
+
- Explain that the path is hidden by an inactive facet this run.
|
|
822
|
+
- Enable the facet for the next run:
|
|
823
|
+
- Prefer a patch to `<stanPath>/system/facet.state.json` setting that facet to `true` (next‑run default), and
|
|
824
|
+
- Tell the user to re‑run with `stan run -f <facet>` (overlay ON; facet active) or `stan run -F` (overlay OFF) for a full baseline.
|
|
825
|
+
- Log the intent in `<stanPath>/system/stan.todo.md` (“enable facet <name> to edit <path> next turn”).
|
|
826
|
+
- Deliver the actual content edits in the next turn after a run with the facet active (or overlay disabled).
|
|
827
|
+
|
|
828
|
+
Allowed mixing (keep velocity without violating integrity)
|
|
829
|
+
- It is OK to:
|
|
830
|
+
- Patch other files that are already visible in this run.
|
|
831
|
+
- Update `facet.meta.json` (e.g., add anchors) together with `facet.state.json`.
|
|
832
|
+
- Create or update anchor documents (breadcrumbs) even when the facet is currently inactive — anchors are always included in the next run once listed in `include`.
|
|
833
|
+
- It is NOT OK to:
|
|
834
|
+
- Emit a content Patch for a file under a facet you are enabling in the same turn.
|
|
835
|
+
- Attempt to override reserved denials (`.git/**`, `<stanPath>/diff/**`, `<stanPath>/patch/**`, and archive outputs under `<stanPath>/output/…`); anchors never override these.
|
|
836
|
+
|
|
837
|
+
Resolution algorithm (assistant‑side; POSIX paths)
|
|
838
|
+
1) Load `.docs.meta.json`. If absent or `overlay.enabled !== true`, skip this guard.
|
|
839
|
+
2) Load `facet.meta.json` and derive subtree roots for each facet’s `exclude` patterns (strip common glob tails like `/**` or `/*`, trim trailing “/”; ignore leaf‑globs such as `**/*.test.ts` for subtree matching).
|
|
840
|
+
3) For each intended patch target:
|
|
841
|
+
- If the target lies under any facet subtree and that facet is inactive per `overlay.effective`, block the edit this turn and propose facet activation instead (see Guardrail).
|
|
842
|
+
4) If overlay metadata is missing but the target file is simply absent from the archive set, treat this as a hidden target; ask to re‑run with `-f <facet>` or `-F` and resume next turn.
|
|
843
|
+
|
|
844
|
+
Optional metadata (CLI nicety; not required)
|
|
845
|
+
- When `overlay.facetRoots: Record<facet, string[]>` is present in `.docs.meta.json`, prefer those pre‑normalized subtree roots over local glob heuristics.
|
|
846
|
+
|
|
847
|
+
Notes
|
|
848
|
+
- Reserved denials and binary screening always win; anchors cannot re‑include them.
|
|
849
|
+
- The goal is two‑turn cadence for hidden targets:
|
|
850
|
+
- Turn N: enable the facet + log intent.
|
|
851
|
+
- Turn N+1: deliver the content edits once the target is present in archives.
|
|
852
|
+
|
|
804
853
|
# Default Task (when files are provided with no extra prompt)
|
|
805
854
|
|
|
806
855
|
Primary objective — Plan-first
|
package/package.json
CHANGED