ctxr-cli 0.1.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/LICENSE +201 -0
- package/README.md +25 -0
- package/dist/adapter.d.ts +18 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +4 -0
- package/dist/adapter.js.map +1 -0
- package/dist/adapters/builtin/index.d.ts +10 -0
- package/dist/adapters/builtin/index.d.ts.map +1 -0
- package/dist/adapters/builtin/index.js +11 -0
- package/dist/adapters/builtin/index.js.map +1 -0
- package/dist/adapters/forge/github.d.ts +9 -0
- package/dist/adapters/forge/github.d.ts.map +1 -0
- package/dist/adapters/forge/github.js +36 -0
- package/dist/adapters/forge/github.js.map +1 -0
- package/dist/adapters/forge/types.d.ts +23 -0
- package/dist/adapters/forge/types.d.ts.map +1 -0
- package/dist/adapters/forge/types.js +2 -0
- package/dist/adapters/forge/types.js.map +1 -0
- package/dist/adapters/harness/claude-code.d.ts +9 -0
- package/dist/adapters/harness/claude-code.d.ts.map +1 -0
- package/dist/adapters/harness/claude-code.js +42 -0
- package/dist/adapters/harness/claude-code.js.map +1 -0
- package/dist/adapters/identity/claude-code.d.ts +11 -0
- package/dist/adapters/identity/claude-code.d.ts.map +1 -0
- package/dist/adapters/identity/claude-code.js +18 -0
- package/dist/adapters/identity/claude-code.js.map +1 -0
- package/dist/adapters/registry.d.ts +16 -0
- package/dist/adapters/registry.d.ts.map +1 -0
- package/dist/adapters/registry.js +29 -0
- package/dist/adapters/registry.js.map +1 -0
- package/dist/adapters/types.d.ts +65 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +12 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +6 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/adapters-generate.d.ts +23 -0
- package/dist/commands/adapters-generate.d.ts.map +1 -0
- package/dist/commands/adapters-generate.js +59 -0
- package/dist/commands/adapters-generate.js.map +1 -0
- package/dist/commands/archive.d.ts +28 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +66 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/catalog-build.d.ts +7 -0
- package/dist/commands/catalog-build.d.ts.map +1 -0
- package/dist/commands/catalog-build.js +15 -0
- package/dist/commands/catalog-build.js.map +1 -0
- package/dist/commands/catalog-check.d.ts +22 -0
- package/dist/commands/catalog-check.d.ts.map +1 -0
- package/dist/commands/catalog-check.js +49 -0
- package/dist/commands/catalog-check.js.map +1 -0
- package/dist/commands/catalog-show.d.ts +13 -0
- package/dist/commands/catalog-show.d.ts.map +1 -0
- package/dist/commands/catalog-show.js +19 -0
- package/dist/commands/catalog-show.js.map +1 -0
- package/dist/commands/check.d.ts +22 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +43 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/doctor.d.ts +27 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +53 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/graph-build.d.ts +24 -0
- package/dist/commands/graph-build.d.ts.map +1 -0
- package/dist/commands/graph-build.js +36 -0
- package/dist/commands/graph-build.js.map +1 -0
- package/dist/commands/graph-query.d.ts +41 -0
- package/dist/commands/graph-query.d.ts.map +1 -0
- package/dist/commands/graph-query.js +63 -0
- package/dist/commands/graph-query.js.map +1 -0
- package/dist/commands/ingest.d.ts +28 -0
- package/dist/commands/ingest.d.ts.map +1 -0
- package/dist/commands/ingest.js +60 -0
- package/dist/commands/ingest.js.map +1 -0
- package/dist/commands/init.d.ts +28 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +203 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/lint.d.ts +30 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +48 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/migrate.d.ts +30 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +56 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/note-resolve.d.ts +14 -0
- package/dist/commands/note-resolve.d.ts.map +1 -0
- package/dist/commands/note-resolve.js +24 -0
- package/dist/commands/note-resolve.js.map +1 -0
- package/dist/commands/rollup-gather.d.ts +21 -0
- package/dist/commands/rollup-gather.d.ts.map +1 -0
- package/dist/commands/rollup-gather.js +40 -0
- package/dist/commands/rollup-gather.js.map +1 -0
- package/dist/commands/rollup-write.d.ts +25 -0
- package/dist/commands/rollup-write.d.ts.map +1 -0
- package/dist/commands/rollup-write.js +43 -0
- package/dist/commands/rollup-write.js.map +1 -0
- package/dist/commands/session-abandon.d.ts +13 -0
- package/dist/commands/session-abandon.d.ts.map +1 -0
- package/dist/commands/session-abandon.js +22 -0
- package/dist/commands/session-abandon.js.map +1 -0
- package/dist/commands/session-list.d.ts +14 -0
- package/dist/commands/session-list.d.ts.map +1 -0
- package/dist/commands/session-list.js +19 -0
- package/dist/commands/session-list.js.map +1 -0
- package/dist/commands/session-reap.d.ts +22 -0
- package/dist/commands/session-reap.d.ts.map +1 -0
- package/dist/commands/session-reap.js +47 -0
- package/dist/commands/session-reap.js.map +1 -0
- package/dist/commands/session-start.d.ts +18 -0
- package/dist/commands/session-start.d.ts.map +1 -0
- package/dist/commands/session-start.js +36 -0
- package/dist/commands/session-start.js.map +1 -0
- package/dist/commands/session-submit.d.ts +27 -0
- package/dist/commands/session-submit.d.ts.map +1 -0
- package/dist/commands/session-submit.js +68 -0
- package/dist/commands/session-submit.js.map +1 -0
- package/dist/commands/source-check.d.ts +21 -0
- package/dist/commands/source-check.d.ts.map +1 -0
- package/dist/commands/source-check.js +54 -0
- package/dist/commands/source-check.js.map +1 -0
- package/dist/commands/source-hash.d.ts +14 -0
- package/dist/commands/source-hash.d.ts.map +1 -0
- package/dist/commands/source-hash.js +34 -0
- package/dist/commands/source-hash.js.map +1 -0
- package/dist/commands/update.d.ts +17 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +25 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/verify.d.ts +23 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +126 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/config/defaults.d.ts +69 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +71 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/load.d.ts +11 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +49 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/render.d.ts +9 -0
- package/dist/config/render.d.ts.map +1 -0
- package/dist/config/render.js +15 -0
- package/dist/config/render.js.map +1 -0
- package/dist/config/schema.d.ts +124 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +142 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/core/agents-doc.d.ts +80 -0
- package/dist/core/agents-doc.d.ts.map +1 -0
- package/dist/core/agents-doc.js +207 -0
- package/dist/core/agents-doc.js.map +1 -0
- package/dist/core/catalog/build.d.ts +49 -0
- package/dist/core/catalog/build.d.ts.map +1 -0
- package/dist/core/catalog/build.js +113 -0
- package/dist/core/catalog/build.js.map +1 -0
- package/dist/core/catalog/model.d.ts +33 -0
- package/dist/core/catalog/model.d.ts.map +1 -0
- package/dist/core/catalog/model.js +58 -0
- package/dist/core/catalog/model.js.map +1 -0
- package/dist/core/checks/catalog-checks.d.ts +4 -0
- package/dist/core/checks/catalog-checks.d.ts.map +1 -0
- package/dist/core/checks/catalog-checks.js +65 -0
- package/dist/core/checks/catalog-checks.js.map +1 -0
- package/dist/core/checks/identity-checks.d.ts +11 -0
- package/dist/core/checks/identity-checks.d.ts.map +1 -0
- package/dist/core/checks/identity-checks.js +39 -0
- package/dist/core/checks/identity-checks.js.map +1 -0
- package/dist/core/checks/integrity-checks.d.ts +23 -0
- package/dist/core/checks/integrity-checks.d.ts.map +1 -0
- package/dist/core/checks/integrity-checks.js +132 -0
- package/dist/core/checks/integrity-checks.js.map +1 -0
- package/dist/core/checks/manifest.d.ts +7 -0
- package/dist/core/checks/manifest.d.ts.map +1 -0
- package/dist/core/checks/manifest.js +20 -0
- package/dist/core/checks/manifest.js.map +1 -0
- package/dist/core/checks/organize-checks.d.ts +18 -0
- package/dist/core/checks/organize-checks.d.ts.map +1 -0
- package/dist/core/checks/organize-checks.js +97 -0
- package/dist/core/checks/organize-checks.js.map +1 -0
- package/dist/core/checks/registry.d.ts +24 -0
- package/dist/core/checks/registry.d.ts.map +1 -0
- package/dist/core/checks/registry.js +33 -0
- package/dist/core/checks/registry.js.map +1 -0
- package/dist/core/checks/types.d.ts +72 -0
- package/dist/core/checks/types.d.ts.map +1 -0
- package/dist/core/checks/types.js +4 -0
- package/dist/core/checks/types.js.map +1 -0
- package/dist/core/checks/write-lifecycle-checks.d.ts +24 -0
- package/dist/core/checks/write-lifecycle-checks.d.ts.map +1 -0
- package/dist/core/checks/write-lifecycle-checks.js +205 -0
- package/dist/core/checks/write-lifecycle-checks.js.map +1 -0
- package/dist/core/command.d.ts +23 -0
- package/dist/core/command.d.ts.map +1 -0
- package/dist/core/command.js +2 -0
- package/dist/core/command.js.map +1 -0
- package/dist/core/content/canonicalize.d.ts +14 -0
- package/dist/core/content/canonicalize.d.ts.map +1 -0
- package/dist/core/content/canonicalize.js +34 -0
- package/dist/core/content/canonicalize.js.map +1 -0
- package/dist/core/conventions.d.ts +21 -0
- package/dist/core/conventions.d.ts.map +1 -0
- package/dist/core/conventions.js +73 -0
- package/dist/core/conventions.js.map +1 -0
- package/dist/core/disclosure/model.d.ts +18 -0
- package/dist/core/disclosure/model.d.ts.map +1 -0
- package/dist/core/disclosure/model.js +45 -0
- package/dist/core/disclosure/model.js.map +1 -0
- package/dist/core/env.d.ts +40 -0
- package/dist/core/env.d.ts.map +1 -0
- package/dist/core/env.js +24 -0
- package/dist/core/env.js.map +1 -0
- package/dist/core/envelope.d.ts +46 -0
- package/dist/core/envelope.d.ts.map +1 -0
- package/dist/core/envelope.js +21 -0
- package/dist/core/envelope.js.map +1 -0
- package/dist/core/errors.d.ts +96 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +267 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/exit-codes.d.ts +32 -0
- package/dist/core/exit-codes.d.ts.map +1 -0
- package/dist/core/exit-codes.js +31 -0
- package/dist/core/exit-codes.js.map +1 -0
- package/dist/core/fs/atomic.d.ts +10 -0
- package/dist/core/fs/atomic.d.ts.map +1 -0
- package/dist/core/fs/atomic.js +31 -0
- package/dist/core/fs/atomic.js.map +1 -0
- package/dist/core/fs/fenced-region.d.ts +47 -0
- package/dist/core/fs/fenced-region.d.ts.map +1 -0
- package/dist/core/fs/fenced-region.js +122 -0
- package/dist/core/fs/fenced-region.js.map +1 -0
- package/dist/core/git/exec.d.ts +28 -0
- package/dist/core/git/exec.d.ts.map +1 -0
- package/dist/core/git/exec.js +21 -0
- package/dist/core/git/exec.js.map +1 -0
- package/dist/core/git/repo.d.ts +63 -0
- package/dist/core/git/repo.d.ts.map +1 -0
- package/dist/core/git/repo.js +91 -0
- package/dist/core/git/repo.js.map +1 -0
- package/dist/core/git/staged.d.ts +10 -0
- package/dist/core/git/staged.d.ts.map +1 -0
- package/dist/core/git/staged.js +49 -0
- package/dist/core/git/staged.js.map +1 -0
- package/dist/core/git/worktree.d.ts +29 -0
- package/dist/core/git/worktree.d.ts.map +1 -0
- package/dist/core/git/worktree.js +61 -0
- package/dist/core/git/worktree.js.map +1 -0
- package/dist/core/graph/model.d.ts +43 -0
- package/dist/core/graph/model.d.ts.map +1 -0
- package/dist/core/graph/model.js +60 -0
- package/dist/core/graph/model.js.map +1 -0
- package/dist/core/graph/persist.d.ts +7 -0
- package/dist/core/graph/persist.d.ts.map +1 -0
- package/dist/core/graph/persist.js +23 -0
- package/dist/core/graph/persist.js.map +1 -0
- package/dist/core/graph/query.d.ts +16 -0
- package/dist/core/graph/query.d.ts.map +1 -0
- package/dist/core/graph/query.js +91 -0
- package/dist/core/graph/query.js.map +1 -0
- package/dist/core/graph/visibility-filter.d.ts +13 -0
- package/dist/core/graph/visibility-filter.d.ts.map +1 -0
- package/dist/core/graph/visibility-filter.js +26 -0
- package/dist/core/graph/visibility-filter.js.map +1 -0
- package/dist/core/hooks.d.ts +34 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js +89 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/identity.d.ts +14 -0
- package/dist/core/identity.d.ts.map +1 -0
- package/dist/core/identity.js +36 -0
- package/dist/core/identity.js.map +1 -0
- package/dist/core/ingest/identity.d.ts +15 -0
- package/dist/core/ingest/identity.d.ts.map +1 -0
- package/dist/core/ingest/identity.js +17 -0
- package/dist/core/ingest/identity.js.map +1 -0
- package/dist/core/ingest/model.d.ts +17 -0
- package/dist/core/ingest/model.d.ts.map +1 -0
- package/dist/core/ingest/model.js +24 -0
- package/dist/core/ingest/model.js.map +1 -0
- package/dist/core/json-config-merge.d.ts +13 -0
- package/dist/core/json-config-merge.d.ts.map +1 -0
- package/dist/core/json-config-merge.js +43 -0
- package/dist/core/json-config-merge.js.map +1 -0
- package/dist/core/markers.d.ts +17 -0
- package/dist/core/markers.d.ts.map +1 -0
- package/dist/core/markers.js +16 -0
- package/dist/core/markers.js.map +1 -0
- package/dist/core/migrations/registry.d.ts +6 -0
- package/dist/core/migrations/registry.d.ts.map +1 -0
- package/dist/core/migrations/registry.js +8 -0
- package/dist/core/migrations/registry.js.map +1 -0
- package/dist/core/migrations/rename-visibility-field.d.ts +3 -0
- package/dist/core/migrations/rename-visibility-field.d.ts.map +1 -0
- package/dist/core/migrations/rename-visibility-field.js +62 -0
- package/dist/core/migrations/rename-visibility-field.js.map +1 -0
- package/dist/core/migrations/types.d.ts +27 -0
- package/dist/core/migrations/types.d.ts.map +1 -0
- package/dist/core/migrations/types.js +2 -0
- package/dist/core/migrations/types.js.map +1 -0
- package/dist/core/notes/checks.d.ts +20 -0
- package/dist/core/notes/checks.d.ts.map +1 -0
- package/dist/core/notes/checks.js +58 -0
- package/dist/core/notes/checks.js.map +1 -0
- package/dist/core/notes/list.d.ts +26 -0
- package/dist/core/notes/list.d.ts.map +1 -0
- package/dist/core/notes/list.js +84 -0
- package/dist/core/notes/list.js.map +1 -0
- package/dist/core/notes/parse.d.ts +12 -0
- package/dist/core/notes/parse.d.ts.map +1 -0
- package/dist/core/notes/parse.js +36 -0
- package/dist/core/notes/parse.js.map +1 -0
- package/dist/core/notes/render.d.ts +7 -0
- package/dist/core/notes/render.d.ts.map +1 -0
- package/dist/core/notes/render.js +13 -0
- package/dist/core/notes/render.js.map +1 -0
- package/dist/core/notes/visibility.d.ts +26 -0
- package/dist/core/notes/visibility.d.ts.map +1 -0
- package/dist/core/notes/visibility.js +41 -0
- package/dist/core/notes/visibility.js.map +1 -0
- package/dist/core/procedures.d.ts +44 -0
- package/dist/core/procedures.d.ts.map +1 -0
- package/dist/core/procedures.js +154 -0
- package/dist/core/procedures.js.map +1 -0
- package/dist/core/queue.d.ts +16 -0
- package/dist/core/queue.d.ts.map +1 -0
- package/dist/core/queue.js +75 -0
- package/dist/core/queue.js.map +1 -0
- package/dist/core/reconcile.d.ts +18 -0
- package/dist/core/reconcile.d.ts.map +1 -0
- package/dist/core/reconcile.js +49 -0
- package/dist/core/reconcile.js.map +1 -0
- package/dist/core/records.d.ts +16 -0
- package/dist/core/records.d.ts.map +1 -0
- package/dist/core/records.js +36 -0
- package/dist/core/records.js.map +1 -0
- package/dist/core/reporter.d.ts +20 -0
- package/dist/core/reporter.d.ts.map +1 -0
- package/dist/core/reporter.js +25 -0
- package/dist/core/reporter.js.map +1 -0
- package/dist/core/root.d.ts +24 -0
- package/dist/core/root.d.ts.map +1 -0
- package/dist/core/root.js +51 -0
- package/dist/core/root.js.map +1 -0
- package/dist/core/security/secrets.d.ts +17 -0
- package/dist/core/security/secrets.d.ts.map +1 -0
- package/dist/core/security/secrets.js +21 -0
- package/dist/core/security/secrets.js.map +1 -0
- package/dist/core/session.d.ts +15 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +27 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/store.d.ts +15 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +19 -0
- package/dist/core/store.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/prompt/inquirer-prompter.d.ts +14 -0
- package/dist/prompt/inquirer-prompter.d.ts.map +1 -0
- package/dist/prompt/inquirer-prompter.js +27 -0
- package/dist/prompt/inquirer-prompter.js.map +1 -0
- package/dist/prompt/prompter.d.ts +24 -0
- package/dist/prompt/prompter.d.ts.map +1 -0
- package/dist/prompt/prompter.js +2 -0
- package/dist/prompt/prompter.js.map +1 -0
- package/dist/run.d.ts +16 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +464 -0
- package/dist/run.js.map +1 -0
- package/dist/taxonomy/profiles.d.ts +31 -0
- package/dist/taxonomy/profiles.d.ts.map +1 -0
- package/dist/taxonomy/profiles.js +45 -0
- package/dist/taxonomy/profiles.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +56 -0
- package/templates/.gitkeep +0 -0
- package/templates/hooks/pre-commit.sh +21 -0
- package/templates/hooks/pre-push.sh +24 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* store-lifecycle spec: schema_version versions STORE STATE (config shape +
|
|
4
|
+
* note frontmatter conventions) — a monotonic integer independent of the npm
|
|
5
|
+
* package version — not "what this CLI release happens to be."
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Bumped to 2 by the visibility-field key rename migration (store-lifecycle
|
|
9
|
+
* spec task 9.2) — proof that renaming DEFAULT_VISIBILITY_FIELD_KEY really
|
|
10
|
+
* is "a config-default change plus a migration, never a spec or code
|
|
11
|
+
* rewrite" (design.md D7): every consumer already reads
|
|
12
|
+
* config.fields.visibility, never a literal key, so nothing else changed.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SUPPORTED_SCHEMA_VERSION = 2;
|
|
15
|
+
export declare const TaxonomyLayerSchema: z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
path: z.ZodString;
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
/**
|
|
21
|
+
* disclosure-policy spec: "v1 keeps the disclosure ladder's shape with a
|
|
22
|
+
* flat, user-defined value list" (design.md) — no registry syntax, just a
|
|
23
|
+
* flat set of audience names the operator considers internal, and a flat
|
|
24
|
+
* list of hard-wall rules evaluated before any tag or visibility rung.
|
|
25
|
+
*/
|
|
26
|
+
declare const HardWallSchema: z.ZodObject<{
|
|
27
|
+
audience: z.ZodString;
|
|
28
|
+
note_path_prefix: z.ZodOptional<z.ZodString>;
|
|
29
|
+
except: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
|
+
verdict: z.ZodEnum<{
|
|
31
|
+
allow: "allow";
|
|
32
|
+
ask: "ask";
|
|
33
|
+
deny: "deny";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
declare const AdapterDeclarationSchema: z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
kind: z.ZodEnum<{
|
|
39
|
+
forge: "forge";
|
|
40
|
+
"harness-generation": "harness-generation";
|
|
41
|
+
"identity-injection": "identity-injection";
|
|
42
|
+
}>;
|
|
43
|
+
module: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const StoreConfigSchema: z.ZodObject<{
|
|
46
|
+
schema_version: z.ZodNumber;
|
|
47
|
+
taxonomy: z.ZodObject<{
|
|
48
|
+
profile: z.ZodString;
|
|
49
|
+
layers: z.ZodArray<z.ZodObject<{
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
path: z.ZodString;
|
|
52
|
+
description: z.ZodString;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
fields: z.ZodObject<{
|
|
56
|
+
visibility: z.ZodString;
|
|
57
|
+
}, z.core.$loose>;
|
|
58
|
+
visibility: z.ZodObject<{
|
|
59
|
+
default_context: z.ZodString;
|
|
60
|
+
directory_defaults: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
61
|
+
contexts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
derived: z.ZodObject<{
|
|
64
|
+
paths: z.ZodArray<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
retrieval: z.ZodObject<{
|
|
67
|
+
exclude_paths: z.ZodArray<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
git: z.ZodObject<{
|
|
70
|
+
default_branch: z.ZodString;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
session: z.ZodObject<{
|
|
73
|
+
branch_prefix: z.ZodString;
|
|
74
|
+
worktrees_path: z.ZodString;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
write_lifecycle: z.ZodObject<{
|
|
77
|
+
diff_size_ceiling_lines: z.ZodNumber;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
catalog: z.ZodObject<{
|
|
80
|
+
path: z.ZodString;
|
|
81
|
+
section_max_bytes: z.ZodNumber;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
disclosure: z.ZodObject<{
|
|
84
|
+
internal_audiences: z.ZodArray<z.ZodString>;
|
|
85
|
+
hard_walls: z.ZodArray<z.ZodObject<{
|
|
86
|
+
audience: z.ZodString;
|
|
87
|
+
note_path_prefix: z.ZodOptional<z.ZodString>;
|
|
88
|
+
except: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
+
verdict: z.ZodEnum<{
|
|
90
|
+
allow: "allow";
|
|
91
|
+
ask: "ask";
|
|
92
|
+
deny: "deny";
|
|
93
|
+
}>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
ingest: z.ZodObject<{
|
|
97
|
+
inbox_path: z.ZodString;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
organize: z.ZodObject<{
|
|
100
|
+
archive_path: z.ZodString;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
identity: z.ZodObject<{
|
|
103
|
+
path: z.ZodString;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
harness: z.ZodObject<{
|
|
106
|
+
procedures_path: z.ZodString;
|
|
107
|
+
conventions_path: z.ZodDefault<z.ZodString>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
adapters: z.ZodArray<z.ZodObject<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
kind: z.ZodEnum<{
|
|
112
|
+
forge: "forge";
|
|
113
|
+
"harness-generation": "harness-generation";
|
|
114
|
+
"identity-injection": "identity-injection";
|
|
115
|
+
}>;
|
|
116
|
+
module: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
118
|
+
}, z.core.$loose>;
|
|
119
|
+
export type StoreConfig = z.infer<typeof StoreConfigSchema>;
|
|
120
|
+
export type TaxonomyLayerConfig = z.infer<typeof TaxonomyLayerSchema>;
|
|
121
|
+
export type HardWallConfig = z.infer<typeof HardWallSchema>;
|
|
122
|
+
export type AdapterDeclaration = z.infer<typeof AdapterDeclarationSchema>;
|
|
123
|
+
export {};
|
|
124
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAC;AAiEH;;;;;GAKG;AACH,QAAA,MAAM,cAAc;;;;;;;;;iBAQlB,CAAC;AAoCH,QAAA,MAAM,wBAAwB;;;;;;;;iBAI5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBd,CAAC;AAEjB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* store-lifecycle spec: schema_version versions STORE STATE (config shape +
|
|
4
|
+
* note frontmatter conventions) — a monotonic integer independent of the npm
|
|
5
|
+
* package version — not "what this CLI release happens to be."
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Bumped to 2 by the visibility-field key rename migration (store-lifecycle
|
|
9
|
+
* spec task 9.2) — proof that renaming DEFAULT_VISIBILITY_FIELD_KEY really
|
|
10
|
+
* is "a config-default change plus a migration, never a spec or code
|
|
11
|
+
* rewrite" (design.md D7): every consumer already reads
|
|
12
|
+
* config.fields.visibility, never a literal key, so nothing else changed.
|
|
13
|
+
*/
|
|
14
|
+
export const SUPPORTED_SCHEMA_VERSION = 2;
|
|
15
|
+
export const TaxonomyLayerSchema = z.object({
|
|
16
|
+
name: z.string().min(1),
|
|
17
|
+
path: z.string().min(1),
|
|
18
|
+
description: z.string().min(1),
|
|
19
|
+
});
|
|
20
|
+
const TaxonomySchema = z.object({
|
|
21
|
+
/** A shipped profile id, or "custom" when a custom taxonomy definition was supplied. */
|
|
22
|
+
profile: z.string().min(1),
|
|
23
|
+
layers: z.array(TaxonomyLayerSchema),
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Loose (passthrough), not strict: a later phase adding its own field key
|
|
27
|
+
* (e.g. audience tagging) must not force every existing store through a
|
|
28
|
+
* migration just to keep loading. schema_version bumps only on a genuinely
|
|
29
|
+
* incompatible change, never on an additive one.
|
|
30
|
+
*/
|
|
31
|
+
const FieldsSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
visibility: z.string().min(1),
|
|
34
|
+
})
|
|
35
|
+
.passthrough();
|
|
36
|
+
const VisibilitySchema = z.object({
|
|
37
|
+
default_context: z.string().min(1),
|
|
38
|
+
directory_defaults: z.record(z.string(), z.string()).default({}),
|
|
39
|
+
/**
|
|
40
|
+
* context-visibility spec (visibility-contexts-and-wall-verdicts): which
|
|
41
|
+
* visibility VALUES each named context can see. A context with no entry
|
|
42
|
+
* sees exactly its own value (identity default) — so an unconfigured
|
|
43
|
+
* store behaves byte-identically to the equality matching this replaced,
|
|
44
|
+
* and an unknown context fails closed to that same identity match.
|
|
45
|
+
*/
|
|
46
|
+
contexts: z.record(z.string(), z.array(z.string())).default({}),
|
|
47
|
+
});
|
|
48
|
+
const DerivedSchema = z.object({
|
|
49
|
+
paths: z.array(z.string()),
|
|
50
|
+
});
|
|
51
|
+
const RetrievalSchema = z.object({
|
|
52
|
+
exclude_paths: z.array(z.string()),
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Recorded once, at init, from whatever branch `git init` actually created
|
|
56
|
+
* (never hardcoded to "main") — this is what lets the pre-push hook refuse
|
|
57
|
+
* a push to the default branch without re-deriving it from a possibly
|
|
58
|
+
* network-dependent `git remote show` at hook time.
|
|
59
|
+
*/
|
|
60
|
+
const GitSchema = z.object({
|
|
61
|
+
default_branch: z.string().min(1),
|
|
62
|
+
});
|
|
63
|
+
const SessionSchema = z.object({
|
|
64
|
+
branch_prefix: z.string().min(1),
|
|
65
|
+
worktrees_path: z.string().min(1),
|
|
66
|
+
});
|
|
67
|
+
const WriteLifecycleSchema = z.object({
|
|
68
|
+
diff_size_ceiling_lines: z.number().int().positive(),
|
|
69
|
+
});
|
|
70
|
+
const CatalogSchema = z.object({
|
|
71
|
+
path: z.string().min(1),
|
|
72
|
+
section_max_bytes: z.number().int().positive(),
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* disclosure-policy spec: "v1 keeps the disclosure ladder's shape with a
|
|
76
|
+
* flat, user-defined value list" (design.md) — no registry syntax, just a
|
|
77
|
+
* flat set of audience names the operator considers internal, and a flat
|
|
78
|
+
* list of hard-wall rules evaluated before any tag or visibility rung.
|
|
79
|
+
*/
|
|
80
|
+
const HardWallSchema = z.object({
|
|
81
|
+
/** A named audience, or "*" to match every audience. */
|
|
82
|
+
audience: z.string().min(1),
|
|
83
|
+
/** Omitted means the wall applies to every note. */
|
|
84
|
+
note_path_prefix: z.string().min(1).optional(),
|
|
85
|
+
/** Audiences this wall does NOT apply to — evaluation falls through to later rungs for them. */
|
|
86
|
+
except: z.array(z.string()).optional(),
|
|
87
|
+
verdict: z.enum(['allow', 'deny', 'ask']),
|
|
88
|
+
});
|
|
89
|
+
const DisclosureSchema = z.object({
|
|
90
|
+
internal_audiences: z.array(z.string()),
|
|
91
|
+
hard_walls: z.array(HardWallSchema),
|
|
92
|
+
});
|
|
93
|
+
/** context-ingest spec: where capture lands raw material before ingest stamps identity onto it. */
|
|
94
|
+
const IngestSchema = z.object({
|
|
95
|
+
inbox_path: z.string().min(1),
|
|
96
|
+
});
|
|
97
|
+
/** context-organize spec: archive's destination — independent of taxonomy layers, so it works under any profile. */
|
|
98
|
+
const OrganizeSchema = z.object({
|
|
99
|
+
archive_path: z.string().min(1),
|
|
100
|
+
});
|
|
101
|
+
/** agent-identity spec: canonical identity files live here, excluded from every retrieval leg. */
|
|
102
|
+
const IdentitySchema = z.object({
|
|
103
|
+
path: z.string().min(1),
|
|
104
|
+
});
|
|
105
|
+
/** harness-portability spec: the portable procedure pack and operator convention docs AGENTS.md's indexes point into. */
|
|
106
|
+
const HarnessSchema = z.object({
|
|
107
|
+
procedures_path: z.string().min(1),
|
|
108
|
+
conventions_path: z.string().min(1).default('.contexture/conventions/'),
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* adapters spec: the one declared-registration mechanism shared by every
|
|
112
|
+
* adapter kind. `module` is reserved for a future third-party-loading path;
|
|
113
|
+
* v1 resolves every entry against the built-in adapter registry by
|
|
114
|
+
* (kind, id).
|
|
115
|
+
*/
|
|
116
|
+
const AdapterKindSchema = z.enum(['harness-generation', 'identity-injection', 'forge']);
|
|
117
|
+
const AdapterDeclarationSchema = z.object({
|
|
118
|
+
id: z.string().min(1),
|
|
119
|
+
kind: AdapterKindSchema,
|
|
120
|
+
module: z.string().min(1).optional(),
|
|
121
|
+
});
|
|
122
|
+
export const StoreConfigSchema = z
|
|
123
|
+
.object({
|
|
124
|
+
schema_version: z.number().int().positive(),
|
|
125
|
+
taxonomy: TaxonomySchema,
|
|
126
|
+
fields: FieldsSchema,
|
|
127
|
+
visibility: VisibilitySchema,
|
|
128
|
+
derived: DerivedSchema,
|
|
129
|
+
retrieval: RetrievalSchema,
|
|
130
|
+
git: GitSchema,
|
|
131
|
+
session: SessionSchema,
|
|
132
|
+
write_lifecycle: WriteLifecycleSchema,
|
|
133
|
+
catalog: CatalogSchema,
|
|
134
|
+
disclosure: DisclosureSchema,
|
|
135
|
+
ingest: IngestSchema,
|
|
136
|
+
organize: OrganizeSchema,
|
|
137
|
+
identity: IdentitySchema,
|
|
138
|
+
harness: HarnessSchema,
|
|
139
|
+
adapters: z.array(AdapterDeclarationSchema),
|
|
140
|
+
})
|
|
141
|
+
.passthrough();
|
|
142
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,wFAAwF;IACxF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC;CACrC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,YAAY,GAAG,CAAC;KACnB,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9B,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,kBAAkB,EAAE,CAA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AC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { StoreConfig } from '../config/schema.js';
|
|
2
|
+
import { type ScannedDoc } from './conventions.js';
|
|
3
|
+
/**
|
|
4
|
+
* context-retrieval spec (task 4.5): the leg-routing rule that tells an
|
|
5
|
+
* agent which of its two retrieval legs to use for a given question — the
|
|
6
|
+
* catalog/graph (contexture-built-and-maintained) or its own direct content
|
|
7
|
+
* matching (grep, scoped by the store's declared exclusion paths). This is
|
|
8
|
+
* one fenced region within AGENTS.md; Phase 8 adds the canonical template's
|
|
9
|
+
* other sections (root-resolution, frontmatter schema, write-path, procedure
|
|
10
|
+
* index) as sibling regions in the same file, never touching this one.
|
|
11
|
+
*/
|
|
12
|
+
export declare const AGENTS_MD_LEG_ROUTING_FENCE: import("./markers.js").Fence;
|
|
13
|
+
export declare function agentsMdPath(root: string): string;
|
|
14
|
+
export declare function renderLegRoutingSection(config: StoreConfig): string[];
|
|
15
|
+
/** Idempotently reconciles AGENTS.md's leg-routing section from current config — called at init and on re-init. */
|
|
16
|
+
export declare function buildAgentsLegRoutingSection(root: string, config: StoreConfig): Promise<{
|
|
17
|
+
changed: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* context-ingest spec (task 6.3): capture is a plain file write an agent
|
|
21
|
+
* does directly with its own tools — no CLI command wraps it, the same
|
|
22
|
+
* "agents gather, the CLI computes/writes/verifies" split that dropped
|
|
23
|
+
* `ctxr search`. This section documents the one rule that write must
|
|
24
|
+
* follow, so it isn't only tribal knowledge: no source-identity fields, and
|
|
25
|
+
* where the file goes.
|
|
26
|
+
*/
|
|
27
|
+
export declare const AGENTS_MD_CAPTURE_FENCE: import("./markers.js").Fence;
|
|
28
|
+
export declare function renderCaptureSection(config: StoreConfig): string[];
|
|
29
|
+
export declare function buildAgentsCaptureSection(root: string, config: StoreConfig): Promise<{
|
|
30
|
+
changed: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* context-organize spec (task 7.1): the placement procedure is
|
|
34
|
+
* documentation driven entirely by the configured taxonomy, never a
|
|
35
|
+
* hardcoded layout — this section is generated purely from
|
|
36
|
+
* `config.taxonomy.layers`, so it reads correctly under PARA, Zettelkasten,
|
|
37
|
+
* Diátaxis, or any custom taxonomy without a single layer name appearing in
|
|
38
|
+
* this file's own source.
|
|
39
|
+
*/
|
|
40
|
+
export declare const AGENTS_MD_PLACEMENT_FENCE: import("./markers.js").Fence;
|
|
41
|
+
export declare function renderPlacementSection(config: StoreConfig): string[];
|
|
42
|
+
export declare function buildAgentsPlacementSection(root: string, config: StoreConfig): Promise<{
|
|
43
|
+
changed: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* harness-portability spec (task 8.5): the canonical template's four
|
|
47
|
+
* required pieces — root-resolution rule, frontmatter schema pointer,
|
|
48
|
+
* write-path rule, and a procedure index — so an agent that has read only
|
|
49
|
+
* this file, with no harness-specific context, has everything it needs
|
|
50
|
+
* (the spec's own "Reading only AGENTS.md is sufficient" scenario).
|
|
51
|
+
*/
|
|
52
|
+
export declare const AGENTS_MD_CANONICAL_FENCE: import("./markers.js").Fence;
|
|
53
|
+
export declare function renderCanonicalSection(config: StoreConfig, procedures: readonly ScannedDoc[]): string[];
|
|
54
|
+
export declare function buildAgentsCanonicalSection(root: string, config: StoreConfig): Promise<{
|
|
55
|
+
changed: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* entry-doc-generation spec: operator conventions as referenced documents.
|
|
59
|
+
* The index lists what is actually on disk at the configured conventions
|
|
60
|
+
* path; contexture ships no seeds here — conventions are definitionally
|
|
61
|
+
* operator-authored, so an empty store's section explains the mechanism.
|
|
62
|
+
*/
|
|
63
|
+
export declare const AGENTS_MD_CONVENTIONS_FENCE: import("./markers.js").Fence;
|
|
64
|
+
export declare function renderConventionsSection(config: StoreConfig, conventions: readonly ScannedDoc[]): string[];
|
|
65
|
+
export declare function buildAgentsConventionsSection(root: string, config: StoreConfig): Promise<{
|
|
66
|
+
changed: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* agent-identity spec (contexture-home-layout): identity reachable open-box
|
|
70
|
+
* — a harness with no identity-injection adapter that reads only AGENTS.md
|
|
71
|
+
* still learns which files carry identity and that they load at session
|
|
72
|
+
* start. References by path only, never inlined content, so editing an
|
|
73
|
+
* identity file never requires regenerating this section.
|
|
74
|
+
*/
|
|
75
|
+
export declare const AGENTS_MD_IDENTITY_FENCE: import("./markers.js").Fence;
|
|
76
|
+
export declare function renderIdentitySection(config: StoreConfig): string[];
|
|
77
|
+
export declare function buildAgentsIdentitySection(root: string, config: StoreConfig): Promise<{
|
|
78
|
+
changed: boolean;
|
|
79
|
+
}>;
|
|
80
|
+
//# sourceMappingURL=agents-doc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-doc.d.ts","sourceRoot":"","sources":["../../src/core/agents-doc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAMpE;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,8BAA4C,CAAC;AAErF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAiBrE;AAED,mHAAmH;AACnH,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAEnH;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,8BAAyC,CAAC;AAE9E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAoBlE;AAED,wBAAsB,yBA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AO,CAAA;CAAE,CAAC,CAEjH"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { CONFIG_FILE_NAME } from './root.js';
|
|
3
|
+
import { excludedPrefixesFor } from './notes/list.js';
|
|
4
|
+
import { scanConventions } from './conventions.js';
|
|
5
|
+
import { identityFilePaths } from './identity.js';
|
|
6
|
+
import { scanProcedures } from './procedures.js';
|
|
7
|
+
import { upsertFencedRegionInFile } from './fs/fenced-region.js';
|
|
8
|
+
import { htmlCommentFence } from './markers.js';
|
|
9
|
+
/**
|
|
10
|
+
* context-retrieval spec (task 4.5): the leg-routing rule that tells an
|
|
11
|
+
* agent which of its two retrieval legs to use for a given question — the
|
|
12
|
+
* catalog/graph (contexture-built-and-maintained) or its own direct content
|
|
13
|
+
* matching (grep, scoped by the store's declared exclusion paths). This is
|
|
14
|
+
* one fenced region within AGENTS.md; Phase 8 adds the canonical template's
|
|
15
|
+
* other sections (root-resolution, frontmatter schema, write-path, procedure
|
|
16
|
+
* index) as sibling regions in the same file, never touching this one.
|
|
17
|
+
*/
|
|
18
|
+
export const AGENTS_MD_LEG_ROUTING_FENCE = htmlCommentFence('retrieval-leg-routing');
|
|
19
|
+
export function agentsMdPath(root) {
|
|
20
|
+
return path.join(root, 'AGENTS.md');
|
|
21
|
+
}
|
|
22
|
+
export function renderLegRoutingSection(config) {
|
|
23
|
+
const exclusions = [...new Set(excludedPrefixesFor(config))];
|
|
24
|
+
return [
|
|
25
|
+
'## Retrieval: which leg to use',
|
|
26
|
+
'',
|
|
27
|
+
'contexture builds and maintains two retrieval tools ahead of time — consult them first:',
|
|
28
|
+
'',
|
|
29
|
+
'- **Catalog** (`ctxr catalog show --section <id>`): a curated, coverage-guaranteed index of every retrievable note, one section per taxonomy layer.',
|
|
30
|
+
'- **Graph** (`ctxr graph query ...`): the wikilink graph between notes — neighbors, shortest path, hubs, orphans.',
|
|
31
|
+
'',
|
|
32
|
+
'For a literal or entity question the catalog and graph do not answer (a specific string, an exact identifier, a phrase),',
|
|
33
|
+
'use your own direct content-matching tool (e.g. grep/ripgrep) against the store, scoped to exclude:',
|
|
34
|
+
'',
|
|
35
|
+
...exclusions.map((prefix) => `- \`${prefix}\``),
|
|
36
|
+
'',
|
|
37
|
+
'There is no `ctxr search` command. Ranked or semantic search is deferred to a future version — do not look for one.',
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/** Idempotently reconciles AGENTS.md's leg-routing section from current config — called at init and on re-init. */
|
|
41
|
+
export async function buildAgentsLegRoutingSection(root, config) {
|
|
42
|
+
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_LEG_ROUTING_FENCE, renderLegRoutingSection(config));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* context-ingest spec (task 6.3): capture is a plain file write an agent
|
|
46
|
+
* does directly with its own tools — no CLI command wraps it, the same
|
|
47
|
+
* "agents gather, the CLI computes/writes/verifies" split that dropped
|
|
48
|
+
* `ctxr search`. This section documents the one rule that write must
|
|
49
|
+
* follow, so it isn't only tribal knowledge: no source-identity fields, and
|
|
50
|
+
* where the file goes.
|
|
51
|
+
*/
|
|
52
|
+
export const AGENTS_MD_CAPTURE_FENCE = htmlCommentFence('capture-and-ingest');
|
|
53
|
+
export function renderCaptureSection(config) {
|
|
54
|
+
return [
|
|
55
|
+
'## Capturing and ingesting new material',
|
|
56
|
+
'',
|
|
57
|
+
`To capture something new, write a plain markdown file directly into \`${config.ingest.inbox_path}\` —`,
|
|
58
|
+
'no CLI command wraps this. That file MUST NOT contain any of these frontmatter fields; contexture assigns',
|
|
59
|
+
'them once, at ingest, and never before:',
|
|
60
|
+
'',
|
|
61
|
+
'- `source_type`',
|
|
62
|
+
'- `source_id`',
|
|
63
|
+
'- `source_hash`',
|
|
64
|
+
'- `ingested`',
|
|
65
|
+
'',
|
|
66
|
+
'Before ingesting, run `ctxr source check <path> --source-id <id>` to get one of four verdicts:',
|
|
67
|
+
'`new`, `already_ingested`, `alternate_source_match`, or `multiple_matches` — the last one means stop and',
|
|
68
|
+
'resolve the ambiguity yourself rather than guessing which existing note it is.',
|
|
69
|
+
'',
|
|
70
|
+
'To ingest, run `ctxr ingest <path> --source-type <type> --source-id <id>`. It stamps the four fields',
|
|
71
|
+
'above onto the file in place and rebuilds the catalog, so the result already has a catalog entry.',
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
export async function buildAgentsCaptureSection(root, config) {
|
|
75
|
+
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_CAPTURE_FENCE, renderCaptureSection(config));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* context-organize spec (task 7.1): the placement procedure is
|
|
79
|
+
* documentation driven entirely by the configured taxonomy, never a
|
|
80
|
+
* hardcoded layout — this section is generated purely from
|
|
81
|
+
* `config.taxonomy.layers`, so it reads correctly under PARA, Zettelkasten,
|
|
82
|
+
* Diátaxis, or any custom taxonomy without a single layer name appearing in
|
|
83
|
+
* this file's own source.
|
|
84
|
+
*/
|
|
85
|
+
export const AGENTS_MD_PLACEMENT_FENCE = htmlCommentFence('placement');
|
|
86
|
+
export function renderPlacementSection(config) {
|
|
87
|
+
const { layers } = config.taxonomy;
|
|
88
|
+
if (layers.length === 0) {
|
|
89
|
+
return [
|
|
90
|
+
'## Placing a new note',
|
|
91
|
+
'',
|
|
92
|
+
'This store\'s taxonomy declares no top-level layers — place new notes directly at the store root (or',
|
|
93
|
+
'wherever related notes already live) and rely on wikilinks and `ctxr graph` for organization,',
|
|
94
|
+
'rather than a folder hierarchy.',
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
const lines = [
|
|
98
|
+
'## Placing a new note',
|
|
99
|
+
'',
|
|
100
|
+
'This store\'s taxonomy declares these layers — choose the one whose description best matches the note:',
|
|
101
|
+
'',
|
|
102
|
+
];
|
|
103
|
+
for (const layer of layers) {
|
|
104
|
+
const directoryDefault = Object.entries(config.visibility.directory_defaults).find(([prefix]) => prefix === layer.path || prefix === `${layer.path}/`)?.[1];
|
|
105
|
+
lines.push(`- **${layer.name}** (\`${layer.path}/\`): ${layer.description}${directoryDefault ? ` Notes here default to visibility "${directoryDefault}" unless given an explicit value.` : ''}`);
|
|
106
|
+
}
|
|
107
|
+
lines.push('', "If no layer fits, use the store's uncategorized/catch-all location and revisit placement later.");
|
|
108
|
+
return lines;
|
|
109
|
+
}
|
|
110
|
+
export async function buildAgentsPlacementSection(root, config) {
|
|
111
|
+
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_PLACEMENT_FENCE, renderPlacementSection(config));
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* harness-portability spec (task 8.5): the canonical template's four
|
|
115
|
+
* required pieces — root-resolution rule, frontmatter schema pointer,
|
|
116
|
+
* write-path rule, and a procedure index — so an agent that has read only
|
|
117
|
+
* this file, with no harness-specific context, has everything it needs
|
|
118
|
+
* (the spec's own "Reading only AGENTS.md is sufficient" scenario).
|
|
119
|
+
*/
|
|
120
|
+
export const AGENTS_MD_CANONICAL_FENCE = htmlCommentFence('canonical');
|
|
121
|
+
export function renderCanonicalSection(config, procedures) {
|
|
122
|
+
const lines = [
|
|
123
|
+
'## Store fundamentals',
|
|
124
|
+
'',
|
|
125
|
+
'### Root resolution',
|
|
126
|
+
'',
|
|
127
|
+
`Every contexture command resolves the store root in this order: an explicit ` +
|
|
128
|
+
'`--root <path>` flag; the `CONTEXTURE_ROOT` environment variable; walking up from the current directory ' +
|
|
129
|
+
`looking for \`${CONFIG_FILE_NAME}\`. No other flag or environment variable selects the root.`,
|
|
130
|
+
'',
|
|
131
|
+
'### Frontmatter schema',
|
|
132
|
+
'',
|
|
133
|
+
`- Visibility field: \`${config.fields.visibility}:\` — resolves explicit value, then directory default, then the ` +
|
|
134
|
+
`configured fail-closed default (\`${config.visibility.default_context}\`). See \`ctxr note resolve <path>\`.`,
|
|
135
|
+
'- Source-identity fields (assigned only by `ctxr ingest`, never hand-written): `source_type`, `source_id`, `source_hash`, `ingested`.',
|
|
136
|
+
'- Disclosure audience tags (optional, hand-written): `audience: [<name>, ...]`.',
|
|
137
|
+
'',
|
|
138
|
+
'### Write path',
|
|
139
|
+
'',
|
|
140
|
+
'Every write to this store happens inside a session worktree, never directly on the default branch: `ctxr ' +
|
|
141
|
+
'session start` creates one, then `ctxr session submit` validates, commits, pushes, and opens (or ' +
|
|
142
|
+
'reports how to open) a pull request. Do not edit files in the store root directly.',
|
|
143
|
+
'',
|
|
144
|
+
'### Procedure index',
|
|
145
|
+
'',
|
|
146
|
+
'Judgment-driven operations, documented as portable markdown under ' +
|
|
147
|
+
`\`${config.harness.procedures_path}\` — read one directly, no harness-specific discovery required:`,
|
|
148
|
+
'',
|
|
149
|
+
];
|
|
150
|
+
for (const procedure of procedures) {
|
|
151
|
+
lines.push(`- [${procedure.title}](${procedure.path})${procedure.description ? ` — ${procedure.description}` : ''}`);
|
|
152
|
+
}
|
|
153
|
+
return lines;
|
|
154
|
+
}
|
|
155
|
+
export async function buildAgentsCanonicalSection(root, config) {
|
|
156
|
+
const procedures = await scanProcedures(root, config);
|
|
157
|
+
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_CANONICAL_FENCE, renderCanonicalSection(config, procedures));
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* entry-doc-generation spec: operator conventions as referenced documents.
|
|
161
|
+
* The index lists what is actually on disk at the configured conventions
|
|
162
|
+
* path; contexture ships no seeds here — conventions are definitionally
|
|
163
|
+
* operator-authored, so an empty store's section explains the mechanism.
|
|
164
|
+
*/
|
|
165
|
+
export const AGENTS_MD_CONVENTIONS_FENCE = htmlCommentFence('store-conventions');
|
|
166
|
+
export function renderConventionsSection(config, conventions) {
|
|
167
|
+
const lines = ['## Store conventions', ''];
|
|
168
|
+
if (conventions.length === 0) {
|
|
169
|
+
lines.push(`This store declares no convention documents yet. Operator-authored conventions (content style, field`, `semantics, house rules) belong as markdown files under \`${config.harness.conventions_path}\` — each is`, 'indexed here on regeneration, referenced by path, never inlined.');
|
|
170
|
+
return lines;
|
|
171
|
+
}
|
|
172
|
+
lines.push('Operator-authored conventions for this store — read the ones relevant to your task:', '');
|
|
173
|
+
for (const doc of conventions) {
|
|
174
|
+
lines.push(`- [${doc.title}](${doc.path})${doc.description ? ` — ${doc.description}` : ''}`);
|
|
175
|
+
}
|
|
176
|
+
return lines;
|
|
177
|
+
}
|
|
178
|
+
export async function buildAgentsConventionsSection(root, config) {
|
|
179
|
+
const conventions = await scanConventions(root, config);
|
|
180
|
+
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_CONVENTIONS_FENCE, renderConventionsSection(config, conventions));
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* agent-identity spec (contexture-home-layout): identity reachable open-box
|
|
184
|
+
* — a harness with no identity-injection adapter that reads only AGENTS.md
|
|
185
|
+
* still learns which files carry identity and that they load at session
|
|
186
|
+
* start. References by path only, never inlined content, so editing an
|
|
187
|
+
* identity file never requires regenerating this section.
|
|
188
|
+
*/
|
|
189
|
+
export const AGENTS_MD_IDENTITY_FENCE = htmlCommentFence('agent-identity');
|
|
190
|
+
export function renderIdentitySection(config) {
|
|
191
|
+
const paths = identityFilePaths(config);
|
|
192
|
+
return [
|
|
193
|
+
'## Agent identity — load at session start',
|
|
194
|
+
'',
|
|
195
|
+
'This store carries durable agent identity as plain files. Before doing anything else in a session,',
|
|
196
|
+
'read all three (harnesses with a native injection mechanism may already have loaded them for you):',
|
|
197
|
+
'',
|
|
198
|
+
...paths.map((p) => `- \`${p}\``),
|
|
199
|
+
'',
|
|
200
|
+
'They are identity, not knowledge: excluded from every retrieval leg, and never edited as part of',
|
|
201
|
+
'ordinary note work.',
|
|
202
|
+
];
|
|
203
|
+
}
|
|
204
|
+
export async function buildAgentsIdentitySection(root, config) {
|
|
205
|
+
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_IDENTITY_FENCE, renderIdentitySection(config));
|
|
206
|
+
}
|
|
207
|
+
//# source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_FENCE: import("../markers.js").Fence;
|
|
4
|
+
export interface CatalogSectionBuildResult {
|
|
5
|
+
id: string;
|
|
6
|
+
file: string;
|
|
7
|
+
noteCount: number;
|
|
8
|
+
changed: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface CatalogBuildResult {
|
|
11
|
+
sections: CatalogSectionBuildResult[];
|
|
12
|
+
totalNotes: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* context-catalog spec: regenerates each section's fenced identity/path
|
|
16
|
+
* entries, preserving any already-authored gloss. Re-running with no
|
|
17
|
+
* underlying change is byte-identical (upsertFencedRegionInFile only writes
|
|
18
|
+
* when content actually differs).
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildCatalog(store: Store): Promise<CatalogBuildResult>;
|
|
21
|
+
export interface CatalogCoverageResult {
|
|
22
|
+
/** Retrievable notes with no catalog entry anywhere. */
|
|
23
|
+
missing: string[];
|
|
24
|
+
/** Catalog entries referencing a path that is no longer a retrievable note (e.g. deleted). */
|
|
25
|
+
dangling: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* context-catalog spec: coverage is a hard invariant in BOTH directions —
|
|
29
|
+
* every retrievable note must have an entry (missing), and every entry must
|
|
30
|
+
* still reference a real, retrievable note (dangling). A deleted note whose
|
|
31
|
+
* stale entry survives a build is exactly the failure this second half
|
|
32
|
+
* catches — `catalog build` only ever ADDS/preserves entries, so removal
|
|
33
|
+
* must be caught here rather than silently left to rot.
|
|
34
|
+
*/
|
|
35
|
+
export declare function checkCatalogCoverage(store: Store): Promise<CatalogCoverageResult>;
|
|
36
|
+
export interface CatalogStaleEntry {
|
|
37
|
+
path: string;
|
|
38
|
+
section: string;
|
|
39
|
+
}
|
|
40
|
+
/** context-catalog spec: an entry whose note has changed since its gloss was confirmed needs review. */
|
|
41
|
+
export declare function checkCatalogStale(store: Store): Promise<CatalogStaleEntry[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Returns null ONLY when `sectionId` doesn't name a configured section — a
|
|
44
|
+
* real section that simply hasn't been built yet (or has no notes) returns
|
|
45
|
+
* an empty string, which is a valid, uninteresting result, not an error.
|
|
46
|
+
*/
|
|
47
|
+
export declare function readCatalogSection(store: Store, sectionId: string, asContext?: string): Promise<string | null>;
|
|
48
|
+
export declare function catalogSectionPath(store: Store, section: CatalogSection): string;
|
|
49
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/core/catalog/build.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,aAAa,+BAA8B,CAAC;AAoBzD,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAmB5E;AAED,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8FAA8F;IAC9F,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAgBvF;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wGAAwG;AACxG,wBAAsB,iBAAiB,CAAC,K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