@interf/compiler 0.1.12 → 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.
- package/README.md +254 -136
- package/dist/commands/benchmark.d.ts.map +1 -1
- package/dist/commands/benchmark.js +65 -84
- package/dist/commands/benchmark.js.map +1 -1
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +19 -3
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/create.d.ts +3 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +34 -9
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/default.d.ts.map +1 -1
- package/dist/commands/default.js +2 -0
- package/dist/commands/default.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/index.d.ts +11 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -16
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-args.d.ts +4 -0
- package/dist/lib/agent-args.d.ts.map +1 -0
- package/dist/lib/agent-args.js +42 -0
- package/dist/lib/agent-args.js.map +1 -0
- package/dist/lib/agent-constants.d.ts +6 -0
- package/dist/lib/agent-constants.d.ts.map +1 -0
- package/dist/lib/agent-constants.js +29 -0
- package/dist/lib/agent-constants.js.map +1 -0
- package/dist/lib/agent-detection.d.ts +8 -0
- package/dist/lib/agent-detection.d.ts.map +1 -0
- package/dist/lib/agent-detection.js +66 -0
- package/dist/lib/agent-detection.js.map +1 -0
- package/dist/lib/agent-execution.d.ts +3 -0
- package/dist/lib/agent-execution.d.ts.map +1 -0
- package/dist/lib/agent-execution.js +207 -0
- package/dist/lib/agent-execution.js.map +1 -0
- package/dist/lib/agent-logs.d.ts +3 -0
- package/dist/lib/agent-logs.d.ts.map +1 -0
- package/dist/lib/agent-logs.js +18 -0
- package/dist/lib/agent-logs.js.map +1 -0
- package/dist/lib/agent-preflight.d.ts +8 -0
- package/dist/lib/agent-preflight.d.ts.map +1 -0
- package/dist/lib/agent-preflight.js +77 -0
- package/dist/lib/agent-preflight.js.map +1 -0
- package/dist/lib/agent-render.d.ts +9 -0
- package/dist/lib/agent-render.d.ts.map +1 -0
- package/dist/lib/agent-render.js +219 -0
- package/dist/lib/agent-render.js.map +1 -0
- package/dist/lib/agent-status.d.ts +4 -0
- package/dist/lib/agent-status.d.ts.map +1 -0
- package/dist/lib/agent-status.js +59 -0
- package/dist/lib/agent-status.js.map +1 -0
- package/dist/lib/agent-types.d.ts +31 -0
- package/dist/lib/agent-types.d.ts.map +1 -0
- package/dist/lib/agent-types.js +2 -0
- package/dist/lib/agent-types.js.map +1 -0
- package/dist/lib/agents.d.ts +7 -49
- package/dist/lib/agents.d.ts.map +1 -1
- package/dist/lib/agents.js +8 -554
- package/dist/lib/agents.js.map +1 -1
- package/dist/lib/benchmark-execution.d.ts +9 -0
- package/dist/lib/benchmark-execution.d.ts.map +1 -0
- package/dist/lib/benchmark-execution.js +488 -0
- package/dist/lib/benchmark-execution.js.map +1 -0
- package/dist/lib/benchmark-paths.d.ts +11 -0
- package/dist/lib/benchmark-paths.d.ts.map +1 -0
- package/dist/lib/benchmark-paths.js +38 -0
- package/dist/lib/benchmark-paths.js.map +1 -0
- package/dist/lib/benchmark-specs.d.ts +8 -0
- package/dist/lib/benchmark-specs.d.ts.map +1 -0
- package/dist/lib/benchmark-specs.js +115 -0
- package/dist/lib/benchmark-specs.js.map +1 -0
- package/dist/lib/benchmark-targets.d.ts +5 -0
- package/dist/lib/benchmark-targets.d.ts.map +1 -0
- package/dist/lib/benchmark-targets.js +72 -0
- package/dist/lib/benchmark-targets.js.map +1 -0
- package/dist/lib/benchmark-types.d.ts +19 -0
- package/dist/lib/benchmark-types.d.ts.map +1 -0
- package/dist/lib/benchmark-types.js +2 -0
- package/dist/lib/benchmark-types.js.map +1 -0
- package/dist/lib/benchmark.d.ts +4 -29
- package/dist/lib/benchmark.d.ts.map +1 -1
- package/dist/lib/benchmark.js +3 -324
- package/dist/lib/benchmark.js.map +1 -1
- package/dist/lib/bundled-templates.d.ts +5 -0
- package/dist/lib/bundled-templates.d.ts.map +1 -0
- package/dist/lib/bundled-templates.js +23 -0
- package/dist/lib/bundled-templates.js.map +1 -0
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +2 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/eval-packs.d.ts +204 -0
- package/dist/lib/eval-packs.d.ts.map +1 -0
- package/dist/lib/eval-packs.js +177 -0
- package/dist/lib/eval-packs.js.map +1 -0
- package/dist/lib/execution-profile.d.ts +18 -0
- package/dist/lib/execution-profile.d.ts.map +1 -0
- package/dist/lib/execution-profile.js +85 -0
- package/dist/lib/execution-profile.js.map +1 -0
- package/dist/lib/interf-bootstrap.d.ts +4 -0
- package/dist/lib/interf-bootstrap.d.ts.map +1 -1
- package/dist/lib/interf-bootstrap.js +71 -68
- package/dist/lib/interf-bootstrap.js.map +1 -1
- package/dist/lib/interf-compile-plan.d.ts +12 -0
- package/dist/lib/interf-compile-plan.d.ts.map +1 -0
- package/dist/lib/interf-compile-plan.js +143 -0
- package/dist/lib/interf-compile-plan.js.map +1 -0
- package/dist/lib/interf-detect.d.ts.map +1 -1
- package/dist/lib/interf-detect.js +11 -10
- package/dist/lib/interf-detect.js.map +1 -1
- package/dist/lib/interf-scaffold.d.ts +1 -10
- package/dist/lib/interf-scaffold.d.ts.map +1 -1
- package/dist/lib/interf-scaffold.js +25 -362
- package/dist/lib/interf-scaffold.js.map +1 -1
- package/dist/lib/interf-workflow-package.d.ts +4 -0
- package/dist/lib/interf-workflow-package.d.ts.map +1 -0
- package/dist/lib/interf-workflow-package.js +131 -0
- package/dist/lib/interf-workflow-package.js.map +1 -0
- package/dist/lib/interf.d.ts +2 -1
- package/dist/lib/interf.d.ts.map +1 -1
- package/dist/lib/interf.js +2 -1
- package/dist/lib/interf.js.map +1 -1
- package/dist/lib/local-workflows.d.ts.map +1 -1
- package/dist/lib/local-workflows.js +8 -12
- package/dist/lib/local-workflows.js.map +1 -1
- package/dist/lib/logger.d.ts +4 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +11 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/obsidian.d.ts.map +1 -1
- package/dist/lib/obsidian.js +7 -3
- package/dist/lib/obsidian.js.map +1 -1
- package/dist/lib/parse.d.ts +2 -2
- package/dist/lib/parse.d.ts.map +1 -1
- package/dist/lib/parse.js +11 -7
- package/dist/lib/parse.js.map +1 -1
- package/dist/lib/registry.js +3 -3
- package/dist/lib/registry.js.map +1 -1
- package/dist/lib/runtime-acceptance.d.ts +4 -0
- package/dist/lib/runtime-acceptance.d.ts.map +1 -0
- package/dist/lib/runtime-acceptance.js +123 -0
- package/dist/lib/runtime-acceptance.js.map +1 -0
- package/dist/lib/runtime-contracts.d.ts +4 -0
- package/dist/lib/runtime-contracts.d.ts.map +1 -0
- package/dist/lib/runtime-contracts.js +63 -0
- package/dist/lib/runtime-contracts.js.map +1 -0
- package/dist/lib/runtime-paths.d.ts +8 -0
- package/dist/lib/runtime-paths.d.ts.map +1 -0
- package/dist/lib/runtime-paths.js +28 -0
- package/dist/lib/runtime-paths.js.map +1 -0
- package/dist/lib/runtime-prompt.d.ts +3 -0
- package/dist/lib/runtime-prompt.d.ts.map +1 -0
- package/dist/lib/runtime-prompt.js +59 -0
- package/dist/lib/runtime-prompt.js.map +1 -0
- package/dist/lib/runtime-reconcile.d.ts +6 -0
- package/dist/lib/runtime-reconcile.d.ts.map +1 -0
- package/dist/lib/runtime-reconcile.js +339 -0
- package/dist/lib/runtime-reconcile.js.map +1 -0
- package/dist/lib/runtime-runs.d.ts +12 -0
- package/dist/lib/runtime-runs.d.ts.map +1 -0
- package/dist/lib/runtime-runs.js +337 -0
- package/dist/lib/runtime-runs.js.map +1 -0
- package/dist/lib/runtime-types.d.ts +42 -0
- package/dist/lib/runtime-types.d.ts.map +1 -0
- package/dist/lib/runtime-types.js +2 -0
- package/dist/lib/runtime-types.js.map +1 -0
- package/dist/lib/runtime.d.ts +6 -58
- package/dist/lib/runtime.d.ts.map +1 -1
- package/dist/lib/runtime.js +5 -614
- package/dist/lib/runtime.js.map +1 -1
- package/dist/lib/schema.d.ts +156 -13
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/schema.js +113 -4
- package/dist/lib/schema.js.map +1 -1
- package/dist/lib/source-config.d.ts +13 -0
- package/dist/lib/source-config.d.ts.map +1 -0
- package/dist/lib/source-config.js +75 -0
- package/dist/lib/source-config.js.map +1 -0
- package/dist/lib/state-artifacts.d.ts +15 -0
- package/dist/lib/state-artifacts.d.ts.map +1 -0
- package/dist/lib/state-artifacts.js +24 -0
- package/dist/lib/state-artifacts.js.map +1 -0
- package/dist/lib/state-health.d.ts +9 -0
- package/dist/lib/state-health.d.ts.map +1 -0
- package/dist/lib/state-health.js +330 -0
- package/dist/lib/state-health.js.map +1 -0
- package/dist/lib/state-io.d.ts +15 -0
- package/dist/lib/state-io.d.ts.map +1 -0
- package/dist/lib/state-io.js +219 -0
- package/dist/lib/state-io.js.map +1 -0
- package/dist/lib/state-paths.d.ts +5 -0
- package/dist/lib/state-paths.d.ts.map +1 -0
- package/dist/lib/state-paths.js +19 -0
- package/dist/lib/state-paths.js.map +1 -0
- package/dist/lib/state-view.d.ts +7 -0
- package/dist/lib/state-view.d.ts.map +1 -0
- package/dist/lib/state-view.js +147 -0
- package/dist/lib/state-view.js.map +1 -0
- package/dist/lib/state.d.ts +6 -46
- package/dist/lib/state.d.ts.map +1 -1
- package/dist/lib/state.js +5 -632
- package/dist/lib/state.js.map +1 -1
- package/dist/lib/summarize-plan.d.ts +1 -0
- package/dist/lib/summarize-plan.d.ts.map +1 -1
- package/dist/lib/summarize-plan.js +10 -0
- package/dist/lib/summarize-plan.js.map +1 -1
- package/dist/lib/user-config.js +2 -2
- package/dist/lib/user-config.js.map +1 -1
- package/dist/lib/validate-helpers.d.ts +21 -0
- package/dist/lib/validate-helpers.d.ts.map +1 -0
- package/dist/lib/validate-helpers.js +72 -0
- package/dist/lib/validate-helpers.js.map +1 -0
- package/dist/lib/validate-interface.d.ts +2 -0
- package/dist/lib/validate-interface.d.ts.map +1 -1
- package/dist/lib/validate-interface.js +103 -53
- package/dist/lib/validate-interface.js.map +1 -1
- package/dist/lib/validate-kb.d.ts +8 -0
- package/dist/lib/validate-kb.d.ts.map +1 -1
- package/dist/lib/validate-kb.js +53 -24
- package/dist/lib/validate-kb.js.map +1 -1
- package/dist/lib/validate.d.ts +1 -1
- package/dist/lib/validate.d.ts.map +1 -1
- package/dist/lib/validate.js +5 -2
- package/dist/lib/validate.js.map +1 -1
- package/dist/lib/workflow-definitions.d.ts +1 -1
- package/dist/lib/workflow-definitions.d.ts.map +1 -1
- package/dist/lib/workflow-definitions.js +90 -166
- package/dist/lib/workflow-definitions.js.map +1 -1
- package/dist/lib/workflow-helpers.d.ts.map +1 -1
- package/dist/lib/workflow-helpers.js +6 -3
- package/dist/lib/workflow-helpers.js.map +1 -1
- package/dist/lib/workflow-stage-runner.d.ts +41 -0
- package/dist/lib/workflow-stage-runner.d.ts.map +1 -0
- package/dist/lib/workflow-stage-runner.js +106 -0
- package/dist/lib/workflow-stage-runner.js.map +1 -0
- package/dist/lib/workflow-starter-docs.d.ts +9 -0
- package/dist/lib/workflow-starter-docs.d.ts.map +1 -0
- package/dist/lib/workflow-starter-docs.js +18 -0
- package/dist/lib/workflow-starter-docs.js.map +1 -0
- package/dist/lib/workflows-interface-contracts.d.ts +24 -0
- package/dist/lib/workflows-interface-contracts.d.ts.map +1 -0
- package/dist/lib/workflows-interface-contracts.js +304 -0
- package/dist/lib/workflows-interface-contracts.js.map +1 -0
- package/dist/lib/workflows-interface.d.ts +3 -10
- package/dist/lib/workflows-interface.d.ts.map +1 -1
- package/dist/lib/workflows-interface.js +117 -365
- package/dist/lib/workflows-interface.js.map +1 -1
- package/dist/lib/workflows-kb.d.ts.map +1 -1
- package/dist/lib/workflows-kb.js +79 -55
- package/dist/lib/workflows-kb.js.map +1 -1
- package/dist/lib/workflows.d.ts.map +1 -1
- package/dist/lib/workflows.js +1 -1
- package/dist/lib/workflows.js.map +1 -1
- package/package.json +15 -4
- package/skills/interface/analyze/SKILL.md +79 -28
- package/skills/interface/compile/SKILL.md +27 -28
- package/skills/interface/create/SKILL.md +53 -230
- package/skills/interface/create/references/compile-plan-format.md +31 -31
- package/skills/interface/create/references/workflows.md +17 -32
- package/skills/interface/query/SKILL.md +15 -1
- package/skills/interface/retrieve/SKILL.md +32 -65
- package/skills/knowledge-base/compile/SKILL.md +59 -83
- package/skills/knowledge-base/compile/references/stage-claims.md +1 -1
- package/skills/knowledge-base/compile/references/stage-entities.md +2 -2
- package/skills/knowledge-base/query/SKILL.md +13 -1
- package/skills/knowledge-base/summarize/SKILL.md +54 -24
- package/templates/interface/README.md +13 -12
- package/templates/interface/interfaces.md +14 -11
- package/templates/knowledge-base/README.md +0 -1
- package/templates/knowledge-base/registry.md +15 -15
- package/templates/workflow-package/README.md +16 -0
- package/templates/workflow-package/create/SKILL.md +8 -0
- package/templates/workflow-package/interface-query/SKILL.md +29 -0
- package/templates/workflow-package/interface-stage/SKILL.md +13 -0
- package/templates/workflow-package/knowledge-base-query/SKILL.md +36 -0
- package/templates/workflow-package/knowledge-base-stage/SKILL.md +13 -0
- package/templates/workflow-starters/interface/interf/README.md +13 -0
- package/templates/workflow-starters/interface/interf/create/SKILL.md +15 -0
- package/templates/workflow-starters/knowledge-base/interf/README.md +13 -0
- package/templates/workflow-starters/knowledge-base/karpathy/README.md +13 -0
|
@@ -27,12 +27,11 @@ Harness role:
|
|
|
27
27
|
1. Read `interf.json` and confirm `type: knowledge-base`.
|
|
28
28
|
2. Read `.interf/stage-contract.json` and treat it as authoritative.
|
|
29
29
|
3. Read `.interf/summarize-targets.json` when present and treat `targets[]` as the source of truth for which files to summarize.
|
|
30
|
+
If a target includes `output`, write the summary to that exact relative path.
|
|
30
31
|
4. Read any local docs listed by the stage contract.
|
|
31
32
|
5. Create one summary file in `summaries/` for each target source file.
|
|
32
33
|
6. Write `.interf/inventory.json`.
|
|
33
|
-
7.
|
|
34
|
-
8. Refresh `.interf/health.json`.
|
|
35
|
-
9. Emit `DONE:` and stop.
|
|
34
|
+
7. Emit `DONE:` and stop.
|
|
36
35
|
|
|
37
36
|
If the CLI provided a summarize plan, do not re-audit the whole knowledge base before writing summaries.
|
|
38
37
|
|
|
@@ -40,14 +39,39 @@ If the CLI provided a summarize plan, do not re-audit the whole knowledge base b
|
|
|
40
39
|
|
|
41
40
|
When launched by the Interf CLI:
|
|
42
41
|
- emit exactly one startup line: `STATUS: loaded summarize plan N files`
|
|
43
|
-
- emit `STATUS: batch committed` only after summary files
|
|
44
|
-
- emit `DONE:
|
|
42
|
+
- emit `STATUS: batch committed` only after summary files and inventory were actually written
|
|
43
|
+
- emit `DONE: summarize complete N/N` when the required writes are complete
|
|
45
44
|
- do not emit per-file progress
|
|
46
45
|
|
|
46
|
+
## Execution bias
|
|
47
|
+
|
|
48
|
+
This stage is a light per-file evidence pass, not a mini research project.
|
|
49
|
+
|
|
50
|
+
- process only the files listed in `.interf/summarize-targets.json`
|
|
51
|
+
- for a single large PDF, deck, or report, do one lightweight evidence pass and then stop
|
|
52
|
+
- for a single large PDF, deck, or report, do at most one routing pass across the document plus one focused follow-up read that covers no more than 3 routed pages or sections
|
|
53
|
+
- capture the file's scope, headline facts that are directly exposed, and whether important evidence also lives in charts or tables
|
|
54
|
+
- if the document repeats the same template across many pages or entities, sample only enough pages to describe that repeated structure and preserve routing for later interfaces
|
|
55
|
+
- do not chase every page, every market, every appendix, or every historical chart in this stage
|
|
56
|
+
- leave narrow task-specific extraction to interface workflows
|
|
57
|
+
- once you can state the document scope, the exposed headline metrics, and where deeper chart/table evidence lives, write the summary immediately
|
|
58
|
+
- once the summary file and inventory are written, stop immediately
|
|
59
|
+
- keep bulk PDF/OCR extraction output out of the run log. Save scratch output to temp files and inspect only the routed slices you need for the summary.
|
|
60
|
+
- keep scratch extraction commands single-purpose and non-destructive. Do not use `rm`, wildcard cleanup, `;`, or `&&` chains during summarize.
|
|
61
|
+
- if a shell pattern is blocked, do not retry the same chained command with minor edits. Switch to a simpler local read path and keep moving.
|
|
62
|
+
- if you have already checked whether the summary file exists and it does not, the next step is to write it rather than doing another exploratory read
|
|
63
|
+
- do not precreate `.interf/inventory.json` with `touch`; write the final JSON document directly
|
|
64
|
+
- when updating `.interf/inventory.json`, rewrite the full JSON document in one whole-file write instead of appending or patching partial lines
|
|
65
|
+
- do not use `apply_patch` or line-matched diffs on `.interf/inventory.json`; replace the file in one complete write
|
|
66
|
+
- when you are ready to write, prefer a direct whole-file shell write such as `cat > path <<'EOF' ... EOF` for summary markdown and the inventory artifact
|
|
67
|
+
- whole-file shell writes for stage artifacts are allowed and preferred here; do not stall deciding between patch-based editing and direct writes
|
|
68
|
+
|
|
47
69
|
## Summary output format
|
|
48
70
|
|
|
49
71
|
Create one markdown file per source file under `summaries/`.
|
|
50
72
|
Every summary filename must end in `.md`, even when the source file is `.txt`, `.pdf`, or another format.
|
|
73
|
+
If the source file already ends in `.md`, keep a single `.md` suffix instead of appending another one.
|
|
74
|
+
When `.interf/summarize-targets.json` provides `targets[].output`, use that exact path instead of inferring a filename.
|
|
51
75
|
|
|
52
76
|
Each summary must include JSON frontmatter with:
|
|
53
77
|
- `source`
|
|
@@ -85,38 +109,44 @@ Keep summaries source-grounded:
|
|
|
85
109
|
- keep titles descriptive and conservative
|
|
86
110
|
- preserve evidence tiers and truth modes
|
|
87
111
|
- keep links sparse and obvious
|
|
112
|
+
- for PDFs, decks, and reports, capture material table/chart/figure evidence when it affects the source's meaning
|
|
113
|
+
- preserve the main headline metrics for the top-level sections or market groups when they are present in extractable text
|
|
114
|
+
- preserve easy headline values from prose or clearly exposed tables when they are central to the source
|
|
115
|
+
- for market reports and dashboards, preserve the main peer groups that are trivial to recover from prose or headline tables, but do not turn summarize into a full market-by-market extraction pass
|
|
116
|
+
- if important evidence appears to live in charts or other visuals, say that clearly in the summary and preserve enough routing detail for a later interface or manual query step
|
|
117
|
+
- do not turn the knowledge-base summarize stage into an exhaustive visual extraction pass across the whole report
|
|
118
|
+
- if exact chart numbers are not directly recoverable from the same page with light local extraction, say so explicitly in the summary instead of flattening the evidence into vague prose
|
|
119
|
+
- when useful, note whether important evidence came from prose, tables, or charts so later interface stages know when raw visual inspection may still be needed
|
|
120
|
+
- distinguish `chart present and relevant` from `exact chart values not yet extracted`
|
|
88
121
|
|
|
89
122
|
This is a per-file evidence stage only. Cross-file synthesis belongs to `knowledge-base/compile`.
|
|
90
123
|
|
|
91
|
-
## Inventory
|
|
124
|
+
## Inventory output
|
|
92
125
|
|
|
93
126
|
Write `.interf/inventory.json` so every source file is accounted for.
|
|
94
127
|
|
|
95
128
|
Minimum shape:
|
|
129
|
+
- prefer the current runtime shape: top-level `entries` plus `total`
|
|
130
|
+
- `total` equal to the actual current source-file count
|
|
131
|
+
- one `entries[]` object per source file
|
|
132
|
+
- each entry should preserve at least `source`, `summary`, and a conservative summarize `status` or `state`
|
|
133
|
+
- per-file routing must let the runtime and validators see which raw file maps to which summary
|
|
96
134
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"total": 3,
|
|
100
|
-
"files": [
|
|
101
|
-
{
|
|
102
|
-
"raw": "company-overview.md",
|
|
103
|
-
"summary": "summaries/company overview.md",
|
|
104
|
-
"status": "summarized"
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Update `.interf/state.json` with:
|
|
111
|
-
- `pending`
|
|
112
|
-
- `summarized`
|
|
113
|
-
- `last_summarize`
|
|
135
|
+
Do not copy canned totals or filenames into the runtime inventory.
|
|
136
|
+
Do not invent new top-level inventory keys when `entries` already fits the run.
|
|
114
137
|
|
|
115
|
-
|
|
138
|
+
The CLI reconciles `.interf/state.json` and refreshes `.interf/health.json` after stage validation.
|
|
139
|
+
For a one-file summarize run, the finish sequence is strict: write the summary file, rewrite `.interf/inventory.json`, emit `STATUS: batch committed`, emit the standard summarize `DONE:` line using the current run counts, and stop.
|
|
116
140
|
|
|
117
141
|
## Guardrails
|
|
118
142
|
|
|
119
143
|
- Do not modify source files.
|
|
120
144
|
- Do not emit `STATUS: batch committed` before files exist on disk.
|
|
145
|
+
- Do not create placeholder JSON files with `touch` before writing the final documents.
|
|
146
|
+
- Do not append a second JSON object to `.interf/inventory.json`. Rewrite the whole file once.
|
|
147
|
+
- Do not use `apply_patch` or line-matched diffs to edit `.interf/inventory.json`.
|
|
148
|
+
- Use a single whole-file write for each required artifact as soon as the summary text is ready.
|
|
149
|
+
- If you check whether a required summary or inventory artifact exists and it is missing, create it next instead of doing another exploratory read.
|
|
150
|
+
- Do not keep mining the source after a usable conservative summary already exists.
|
|
121
151
|
- Do not keep browsing after the required writes are complete.
|
|
122
152
|
- If a required path is missing or unreadable, emit one `BLOCKED:` or `ERROR:` line with the concrete reason and stop.
|
|
@@ -44,13 +44,12 @@ State bridges between steps. If step 2 fails, the next run resumes from step 2.
|
|
|
44
44
|
|
|
45
45
|
## Workflows
|
|
46
46
|
|
|
47
|
-
Shipped interface
|
|
48
|
-
- `
|
|
49
|
-
- `research`
|
|
50
|
-
- `audit`
|
|
47
|
+
Shipped built-in interface workflow:
|
|
48
|
+
- `interf`
|
|
51
49
|
|
|
52
50
|
The selected workflow is written to `interf.json` and can seed starter local `workflow/` docs.
|
|
53
|
-
|
|
51
|
+
Use `compile-plan.md` for interface-specific direction such as target entities, years, metrics, chart families, and output focus.
|
|
52
|
+
Create a reusable local workflow only when you want a named method variation you expect to reuse across multiple interfaces.
|
|
54
53
|
|
|
55
54
|
## Bundled stage skills
|
|
56
55
|
|
|
@@ -69,17 +68,18 @@ Minimal. Source of truth for type and knowledge-base reference.
|
|
|
69
68
|
{
|
|
70
69
|
"type": "interface",
|
|
71
70
|
"name": "weekly-briefing",
|
|
72
|
-
"workflow": "
|
|
71
|
+
"workflow": "interf",
|
|
73
72
|
"knowledge_base": {
|
|
74
73
|
"path": "../.."
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
```
|
|
78
77
|
|
|
79
|
-
`knowledge_base.path` points to the parent knowledge base. All filter criteria, extraction goals, and output specs live in `compile-plan.md`.
|
|
80
|
-
`workflow` records the selected
|
|
78
|
+
`knowledge_base.path` points to the parent knowledge base. All interface-specific filter criteria, extraction goals, and output specs live in `compile-plan.md`.
|
|
79
|
+
`workflow` records the selected reusable method. Interf generates per-run stage contracts from it for this interface.
|
|
81
80
|
|
|
82
|
-
If you want
|
|
81
|
+
If you want to specialize this specific interface, refine `compile-plan.md`.
|
|
82
|
+
If you want a reusable retrieval, ontology, or output method, use a workflow and local `workflow/`.
|
|
83
83
|
If you want a different stage graph, proof model, or required artifacts, that is effectively a new workflow.
|
|
84
84
|
|
|
85
85
|
`AGENTS.md` is the source of truth. `CLAUDE.md` is a generated mirror so Claude Code picks up the same interface instructions automatically.
|
|
@@ -109,7 +109,7 @@ If you need a different stage chain, artifact contract, or verifier flow, create
|
|
|
109
109
|
If your coding agent is sandboxed to the current directory tree, launch it from the source folder so the source root, knowledge base, and this interface all stay reachable.
|
|
110
110
|
Use `../../.interf/source-access.json` to verify that raw files are actually reachable before you depend on raw fallback in a manual agent session. `suggested_checks` are canonical absolute file paths so they remain valid from inside the interface folder.
|
|
111
111
|
|
|
112
|
-
If Obsidian viewer defaults are enabled during `interf init`, newly created interfaces get minimal `.obsidian/graph.json` defaults. They are not registered as standalone
|
|
112
|
+
If Obsidian viewer defaults are enabled during `interf init`, newly created interfaces get minimal `.obsidian/graph.json` defaults. They are not registered as standalone workspaces by default; browse them from the parent knowledge-base workspace in Obsidian so knowledge-base summaries and source links remain navigable.
|
|
113
113
|
|
|
114
114
|
## Runtime files
|
|
115
115
|
|
|
@@ -136,7 +136,8 @@ Generated by `interface/create`. Defines:
|
|
|
136
136
|
- Stage 2: extraction goals and allowed runtime refinements
|
|
137
137
|
- Stage 3: output specs for the local context shell
|
|
138
138
|
|
|
139
|
-
This is the
|
|
139
|
+
This is the interface-specific customization layer for the built-in `interf` workflow unless you choose a reusable local workflow instead.
|
|
140
|
+
Compile can refine it when the evidence clearly demands better local structure.
|
|
140
141
|
|
|
141
142
|
## Key principles
|
|
142
143
|
|
|
@@ -153,6 +154,6 @@ This is the initial interface definition. Compile can refine it when the evidenc
|
|
|
153
154
|
## Reset
|
|
154
155
|
|
|
155
156
|
```text
|
|
156
|
-
interf reset compile remove knowledge/ + briefs
|
|
157
|
+
interf reset compile remove knowledge/ + briefs/, keep summaries/ + config
|
|
157
158
|
interf reset all remove all generated content, preserve config files
|
|
158
159
|
```
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
# Interface
|
|
1
|
+
# Interface Patterns
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Interf currently ships one built-in interface workflow: `interf`.
|
|
4
|
+
That workflow always runs retrieve -> analyze -> compile.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
What changes from interface to interface is the use case, the `compile-plan.md` customization, and any optional local workflow extension docs.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Use the patterns below as planning lenses you can encode in `compile-plan.md` or a reusable local interface workflow. They are not built-in workflow ids.
|
|
9
|
+
|
|
10
|
+
Benchmark queries exist today as validation prompts and expected behaviors. The automated benchmark runner and score logging loop are implemented separately from this shipped template reference.
|
|
8
11
|
|
|
9
12
|
---
|
|
10
13
|
|
|
11
|
-
##
|
|
14
|
+
## Current-State Briefing Lens
|
|
12
15
|
|
|
13
16
|
Current-state briefing. Best when you want the latest truth, recent changes, and immediate next steps.
|
|
14
17
|
|
|
@@ -34,7 +37,7 @@ Current-state briefing. Best when you want the latest truth, recent changes, and
|
|
|
34
37
|
|
|
35
38
|
---
|
|
36
39
|
|
|
37
|
-
##
|
|
40
|
+
## Research Synthesis Lens
|
|
38
41
|
|
|
39
42
|
Research synthesis. Best when you want themes, contradictions, evidence strength, and open questions from a dense knowledge base.
|
|
40
43
|
|
|
@@ -60,7 +63,7 @@ Research synthesis. Best when you want themes, contradictions, evidence strength
|
|
|
60
63
|
|
|
61
64
|
---
|
|
62
65
|
|
|
63
|
-
##
|
|
66
|
+
## Gap Review Lens
|
|
64
67
|
|
|
65
68
|
Audit and gap-finding. Best when you want to improve knowledge-base quality, spot stale areas, and surface missing or contradictory evidence.
|
|
66
69
|
|
|
@@ -84,12 +87,12 @@ Audit and gap-finding. Best when you want to improve knowledge-base quality, spo
|
|
|
84
87
|
|
|
85
88
|
---
|
|
86
89
|
|
|
87
|
-
## Self-improving
|
|
90
|
+
## Self-improving Loop
|
|
88
91
|
|
|
89
|
-
Every interface
|
|
92
|
+
Every interface can carry benchmark queries. The intended validation cycle is:
|
|
90
93
|
|
|
91
|
-
1. Build the interface from its config
|
|
92
|
-
2. Run benchmark queries against the
|
|
94
|
+
1. Build the interface from its config and current compile plan
|
|
95
|
+
2. Run benchmark queries against the compiled interface workspace
|
|
93
96
|
3. Score: did each query return expected behavior?
|
|
94
97
|
4. If score is below threshold:
|
|
95
98
|
- Analyze failures
|
|
@@ -133,6 +133,5 @@ See `docs/runtime-contract.md` for the human-readable contract and `src/lib/sche
|
|
|
133
133
|
|
|
134
134
|
```text
|
|
135
135
|
interf reset compile remove knowledge/, keep summaries/
|
|
136
|
-
interf reset summarize remove summaries/
|
|
137
136
|
interf reset all remove all generated content, preserve source files
|
|
138
137
|
```
|
|
@@ -9,8 +9,8 @@ The registry at `~/.interf/registry.json` tracks all knowledge bases and interfa
|
|
|
9
9
|
"version": 5,
|
|
10
10
|
"knowledgeBases": [
|
|
11
11
|
{
|
|
12
|
-
"name": "
|
|
13
|
-
"path": "/path/to/
|
|
12
|
+
"name": "market-intel",
|
|
13
|
+
"path": "/path/to/market-intel",
|
|
14
14
|
"workflow": "interf",
|
|
15
15
|
"created": "2026-03-30T14:00:00Z"
|
|
16
16
|
},
|
|
@@ -23,19 +23,19 @@ The registry at `~/.interf/registry.json` tracks all knowledge bases and interfa
|
|
|
23
23
|
],
|
|
24
24
|
"interfaces": [
|
|
25
25
|
{
|
|
26
|
-
"name": "
|
|
27
|
-
"path": "/path/to/
|
|
26
|
+
"name": "q2-launch-brief",
|
|
27
|
+
"path": "/path/to/q2-launch-brief",
|
|
28
28
|
"knowledgeBase": "ops",
|
|
29
29
|
"knowledgeBasePath": "/path/to/ops",
|
|
30
|
-
"workflow": "
|
|
30
|
+
"workflow": "interf",
|
|
31
31
|
"created": "2026-03-30T16:00:00Z"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
"name": "gap-
|
|
35
|
-
"path": "/path/to/gap-
|
|
36
|
-
"knowledgeBase": "
|
|
37
|
-
"knowledgeBasePath": "/path/to/
|
|
38
|
-
"workflow": "
|
|
34
|
+
"name": "pricing-gap-review",
|
|
35
|
+
"path": "/path/to/pricing-gap-review",
|
|
36
|
+
"knowledgeBase": "market-intel",
|
|
37
|
+
"knowledgeBasePath": "/path/to/market-intel",
|
|
38
|
+
"workflow": "interf",
|
|
39
39
|
"created": "2026-03-30T16:30:00Z"
|
|
40
40
|
}
|
|
41
41
|
]
|
|
@@ -55,7 +55,7 @@ The registry at `~/.interf/registry.json` tracks all knowledge bases and interfa
|
|
|
55
55
|
- `path` — absolute path to interface root
|
|
56
56
|
- `knowledgeBase` — name of the connected knowledge base
|
|
57
57
|
- `knowledgeBasePath` — absolute path to the connected knowledge base
|
|
58
|
-
- `workflow` — selected methodology
|
|
58
|
+
- `workflow` — selected methodology (`interf` for the shipped default, or a local workflow id)
|
|
59
59
|
- `created` — ISO timestamp
|
|
60
60
|
|
|
61
61
|
## When it's updated
|
|
@@ -96,13 +96,13 @@ $ interf list
|
|
|
96
96
|
|
|
97
97
|
Knowledge Bases
|
|
98
98
|
─────────────────────────────────
|
|
99
|
-
|
|
100
|
-
ops
|
|
99
|
+
market-intel 1,240 files compiled
|
|
100
|
+
ops 892 files 3 pending
|
|
101
101
|
|
|
102
102
|
Interfaces
|
|
103
103
|
─────────────────────────────────
|
|
104
|
-
|
|
105
|
-
gap-
|
|
104
|
+
q2-launch-brief → ops compiled
|
|
105
|
+
pricing-gap-review → market-intel stale (12 new)
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
## Creation
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# {{workflow_label}}
|
|
2
|
+
|
|
3
|
+
This is the local {{target_type}} workflow package. Interf uses it when you run `interf compile`.
|
|
4
|
+
|
|
5
|
+
- `workflow.json` defines the stage graph and contract kinds for this workspace.
|
|
6
|
+
- `create/` explains what the scaffold/setup step produces.
|
|
7
|
+
- `compile/stages/` contains one stage folder per compile stage.
|
|
8
|
+
- `use/query/` explains how to use the compiled knowledge base or interface in manual agent sessions.
|
|
9
|
+
|
|
10
|
+
Workflow id: `{{workflow_id}}`
|
|
11
|
+
Method: {{workflow_hint}}
|
|
12
|
+
|
|
13
|
+
Compile stages:
|
|
14
|
+
{{stage_lines}}
|
|
15
|
+
|
|
16
|
+
Interf CLI remains the referee for contracts, proofs, validators, and runtime state under `.interf/`.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Create
|
|
2
|
+
|
|
3
|
+
This doc explains what Interf scaffolded for the selected {{target_type}} workflow.
|
|
4
|
+
|
|
5
|
+
- selected workflow: `{{workflow_id}}`
|
|
6
|
+
- method: {{workflow_hint}}
|
|
7
|
+
- the CLI owns create-time validation, folder creation, config writing, and bootstrap docs
|
|
8
|
+
- edit this workflow package after scaffold if you want to refine how later compile/query behavior works
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Interface Query
|
|
2
|
+
|
|
3
|
+
{{top_preflight}}
|
|
4
|
+
Use this skill when answering questions from inside this interface in a manual agent session.
|
|
5
|
+
AGENTS.md should route manual questions here before an agent starts browsing notes on its own.
|
|
6
|
+
Treat this as the interface-local query layer, not a replacement for the parent knowledge-base query loop.
|
|
7
|
+
This is a workspace-local query doc, not a required globally installed slash-command skill.
|
|
8
|
+
|
|
9
|
+
Default loop:
|
|
10
|
+
- start with `AGENTS.md`, then `home.md`
|
|
11
|
+
- browse local `knowledge/`, `briefs/`, and local `summaries/` first
|
|
12
|
+
- answer direct target questions from the hero brief before widening scope
|
|
13
|
+
- follow wikilinks and backlinks outward before treating one note as complete
|
|
14
|
+
- if local interface artifacts are insufficient, load and follow the parent knowledge-base query guidance at `../../workflow/use/query/SKILL.md` before going raw
|
|
15
|
+
- use parent knowledge-base artifacts in this order: `../../home.md`, then `../../knowledge/`, then `../../summaries/`
|
|
16
|
+
- when a caller asks for a trace, audit log, or `artifacts_consulted` list, record local `workflow/use/query/SKILL.md` after you inspect it
|
|
17
|
+
- when you climb to the parent knowledge-base query loop, record `../../workflow/use/query/SKILL.md` after you inspect it
|
|
18
|
+
|
|
19
|
+
First-reply rule:
|
|
20
|
+
{{first_reply_rule}}
|
|
21
|
+
|
|
22
|
+
Task bias:
|
|
23
|
+
- reuse the exact metric and period words from the question
|
|
24
|
+
- if the target ledger marks a value approximate, say the literal word `approximate`
|
|
25
|
+
- if the target ledger marks a value chart-derived or table-derived, say that literally
|
|
26
|
+
- prefer the target ledger's `bin_choice` when the question is bin-shaped, and the `value_display` when the question asks for the approximate reading itself
|
|
27
|
+
- do not add raw-access commentary unless the question asks about raw access
|
|
28
|
+
|
|
29
|
+
Keep the interface-specific routing here. Keep raw-source, PDF/chart, and general fallback policy in `../../workflow/use/query/SKILL.md`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"mode": "extend"
|
|
4
|
+
}
|
|
5
|
+
---
|
|
6
|
+
# {{stage_label}}
|
|
7
|
+
|
|
8
|
+
This workflow stage customizes the built-in {{contract_type}} contract for the `{{workflow_id}}` interface workflow.
|
|
9
|
+
|
|
10
|
+
- purpose: {{stage_description}}
|
|
11
|
+
{{stage_notes}}
|
|
12
|
+
|
|
13
|
+
Interf still enforces the same contract reads, writes, coverage proof rules, validators, and runtime reconciliation for this stage.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Knowledge Base Query
|
|
2
|
+
|
|
3
|
+
{{top_preflight}}
|
|
4
|
+
Use this skill when answering questions from inside this knowledge base in a manual agent session.
|
|
5
|
+
AGENTS.md should route manual questions here before an agent starts browsing notes on its own.
|
|
6
|
+
This is the canonical parent-knowledge-base query loop that attached interfaces can inherit before raw fallback.
|
|
7
|
+
This is a workspace-local query doc, not a required globally installed slash-command skill.
|
|
8
|
+
|
|
9
|
+
Default loop:
|
|
10
|
+
- start with `AGENTS.md`, then `home.md`
|
|
11
|
+
- browse `knowledge/` indexes, entities, and claims first
|
|
12
|
+
- follow wikilinks and backlinks outward before treating one note as complete
|
|
13
|
+
- use `summaries/` for deeper evidence
|
|
14
|
+
- use raw source files only when needed for verification, direct quotes, ambiguity, or missing context
|
|
15
|
+
- when a caller asks for a trace, audit log, or `artifacts_consulted` list, record `workflow/use/query/SKILL.md` after you inspect it
|
|
16
|
+
|
|
17
|
+
Raw-source gate:
|
|
18
|
+
- inspect `.interf/source-access.json` before depending on raw files
|
|
19
|
+
- actually open and inspect at least one `suggested_checks` path before claiming raw-file verification; a plain existence check is not enough
|
|
20
|
+
- if raw files are not reachable, say the answer is based on compiled knowledge-base artifacts only
|
|
21
|
+
- when the question depends on exact figures, direct quotes, chart values, table values, or image-derived evidence, raw inspection is required before answering confidently
|
|
22
|
+
|
|
23
|
+
PDF / chart rule:
|
|
24
|
+
- if the source is a PDF, deck, or report and the needed evidence may live in charts, tables, or figures, do not assume the default text layer or existing notes captured everything
|
|
25
|
+
- if summaries do not preserve the needed numeric detail, inspect the raw source and say whether the value was text-derived, table-derived, or chart-derived
|
|
26
|
+
- opening the PDF with `Read` is not enough for an exact-value chart question; take a machine-readable extraction path before answering
|
|
27
|
+
- choose that extraction path from the local environment you actually have instead of assuming specific tools
|
|
28
|
+
- verify the chosen local extraction path is actually available before depending on it; if it is missing, switch once to another available local path
|
|
29
|
+
- if the first local extraction method misses the number, attempt another local recovery path before settling for a visual estimate
|
|
30
|
+
- if the chart does not expose exact numbers as text, say that clearly instead of pretending the compiled notes were sufficient
|
|
31
|
+
- if you can only estimate from the chart, label the answer `approximate` and keep the precision gap explicit
|
|
32
|
+
|
|
33
|
+
First-reply rule:
|
|
34
|
+
{{first_reply_rule}}
|
|
35
|
+
|
|
36
|
+
You can edit this file to bias manual question-answering behavior without changing workflow stage logic.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"mode": "extend"
|
|
4
|
+
}
|
|
5
|
+
---
|
|
6
|
+
# {{stage_label}}
|
|
7
|
+
|
|
8
|
+
This workflow stage customizes the built-in {{contract_type}} contract for the `{{workflow_id}}` knowledge-base workflow.
|
|
9
|
+
|
|
10
|
+
- purpose: {{stage_description}}
|
|
11
|
+
{{stage_notes}}
|
|
12
|
+
|
|
13
|
+
Interf still enforces the same contract reads, writes, proof rules, validators, and runtime reconciliation for this stage.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"mode": "extend"
|
|
4
|
+
}
|
|
5
|
+
---
|
|
6
|
+
# Interf Interface Workflow
|
|
7
|
+
|
|
8
|
+
Bias this interface toward the concrete user task, durable evidence routing, and answer-ready outputs.
|
|
9
|
+
|
|
10
|
+
- turn the requested task into a bounded target set before broadening scope
|
|
11
|
+
- preserve named entities, periods, metrics, units, and comparators instead of collapsing them into generic prose
|
|
12
|
+
- when exact values matter, keep text-derived, table-derived, and chart-derived evidence distinct
|
|
13
|
+
- prefer one concise hero brief and the smallest supporting note set that lets weaker agents answer reliably
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"mode": "extend"
|
|
4
|
+
}
|
|
5
|
+
---
|
|
6
|
+
# Interf Create Bias
|
|
7
|
+
|
|
8
|
+
Turn the user's requested task into a concrete compile plan the later stages can actually execute.
|
|
9
|
+
|
|
10
|
+
- treat `compile-plan.md` as the primary durable output of create; leave scaffolded `AGENTS.md` alone unless it is materially wrong
|
|
11
|
+
- preserve the exact requested use-case line in `compile-plan.md` instead of leaving the generic workflow placeholder
|
|
12
|
+
- carry named markets, years, metrics, units, comparators, and source families verbatim into the target ledger
|
|
13
|
+
- if the task depends on exact values from reports, PDFs, charts, or tables, require a concrete local extraction path instead of vague raw-reading language
|
|
14
|
+
- keep the interface bounded; do not widen into a general report summary unless a comparator or calibration anchor is genuinely needed
|
|
15
|
+
- for automated runs, emit these canonical status markers verbatim and on their own lines: `STATUS: loaded interface creation contract.`, `STATUS: analyzed knowledge-base.`, `STATUS: wrote compile plan.`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"mode": "extend"
|
|
4
|
+
}
|
|
5
|
+
---
|
|
6
|
+
# Interf Knowledge Base Workflow
|
|
7
|
+
|
|
8
|
+
Bias this knowledge base toward source-grounded summaries, explicit evidence tiers, and retrieval-ready compile outputs.
|
|
9
|
+
|
|
10
|
+
- keep summary titles and abstracts conservative and source-grounded
|
|
11
|
+
- preserve evidence tiers, truth modes, and draft-vs-final distinctions
|
|
12
|
+
- compile durable entities, claims, indexes, and navigation that make later interfaces easier to retrieve from
|
|
13
|
+
- prefer structures that help agents prove what they scanned, selected, and excluded before synthesis
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"mode": "extend"
|
|
4
|
+
}
|
|
5
|
+
---
|
|
6
|
+
# Karpathy Knowledge Base Workflow
|
|
7
|
+
|
|
8
|
+
Bias this knowledge base toward the source folder -> summaries -> compiled markdown knowledge-base loop.
|
|
9
|
+
|
|
10
|
+
- keep per-source summaries legible and source-grounded
|
|
11
|
+
- prefer markdown-native knowledge artifacts an agent can browse and file back into the base
|
|
12
|
+
- preserve backlinks and local browseability across the knowledge layer
|
|
13
|
+
- treat the compiled base as a maintained working surface for later questions, not just a one-shot export
|