@nazty_labs/common-ground 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +64 -0
- package/SETUP.md +219 -0
- package/dist/access.d.ts +172 -0
- package/dist/access.js +175 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +198 -0
- package/dist/commands.d.ts +189 -0
- package/dist/commands.js +202 -0
- package/dist/discovery.d.ts +73 -0
- package/dist/discovery.js +417 -0
- package/dist/errors.d.ts +15 -0
- package/dist/errors.js +22 -0
- package/dist/export.d.ts +14 -0
- package/dist/export.js +86 -0
- package/dist/guidance.d.ts +11 -0
- package/dist/guidance.js +75 -0
- package/dist/hooks.d.ts +4 -0
- package/dist/hooks.js +141 -0
- package/dist/init.d.ts +304 -0
- package/dist/init.js +150 -0
- package/dist/maintenance.d.ts +126 -0
- package/dist/maintenance.js +23 -0
- package/dist/matching.d.ts +17 -0
- package/dist/matching.js +32 -0
- package/dist/model.d.ts +974 -0
- package/dist/model.js +21 -0
- package/dist/navigation.d.ts +164 -0
- package/dist/navigation.js +164 -0
- package/dist/operations.d.ts +10 -0
- package/dist/operations.js +130 -0
- package/dist/paging.d.ts +5 -0
- package/dist/paging.js +32 -0
- package/dist/retrieval.d.ts +146 -0
- package/dist/retrieval.js +150 -0
- package/dist/review-files.d.ts +3 -0
- package/dist/review-files.js +106 -0
- package/dist/review.d.ts +86 -0
- package/dist/review.js +124 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.js +105 -0
- package/dist/source-search.d.ts +63 -0
- package/dist/source-search.js +245 -0
- package/dist/store.d.ts +452 -0
- package/dist/store.js +718 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/dist/workflow.d.ts +450 -0
- package/dist/workflow.js +317 -0
- package/docs/architecture.md +65 -0
- package/docs/audit-0.4.0.md +42 -0
- package/docs/demo.md +42 -0
- package/docs/discovery.md +70 -0
- package/docs/knowledge-policy.md +51 -0
- package/docs/pillar-contract.md +98 -0
- package/docs/quiet-workflow.md +98 -0
- package/docs/releases.md +157 -0
- package/package.json +52 -0
- package/schemas/admission.schema.json +75 -0
- package/schemas/knowledge.schema.json +192 -0
- package/schemas/patch.schema.json +220 -0
- package/schemas/update.schema.json +218 -0
package/dist/guidance.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const bootstrapNext = { action: 'review-map-and-facts', approvalRequired: true,
|
|
2
|
+
command: 'cground bootstrap PLAN.json --dry-run', schema: 'cground schema bootstrap',
|
|
3
|
+
guide: '.common-ground/START_HERE.md', authorization: 'Draft by default. Explicit developer delegation to save/publish the initial map may authorize publication within scope; flags and tokens do not supply permission.' };
|
|
4
|
+
export const rules = `## Common Ground
|
|
5
|
+
|
|
6
|
+
Code is the source of truth; these notes only help navigation.
|
|
7
|
+
|
|
8
|
+
For repository questions, use cground lookup with a path or short query for facts and source locations. Lookup is stateless; default freshness is not checked. Open source and directory READMEs before relying on claims. Use --verify when live freshness matters. Derive temporary state live.
|
|
9
|
+
|
|
10
|
+
Keep the developer task primary. After edits, cground assess --touched checks only this task's actual paths, including additions/deletions. No matching source change means no fact review or task bookkeeping; still review relevant local documentation. Source drift means check the affected claims, not automatic revision. Follow additional semantic connections found in source.
|
|
11
|
+
|
|
12
|
+
If corrections are needed, request assess --review. Before editing, read [.common-ground/POLICY.md](.common-ground/POLICY.md), every required chapter page and the listed sources/docs. prepare-patch works without taskId; complete review and conflict checks remain mandatory. Summarize actual corrections as before → after, why, source links and recommendation.
|
|
13
|
+
|
|
14
|
+
Task contexts are optional for aggregated reporting and deferred additions. Start one when needed; propose_facts queues drafts, finish after the main task, then ask "Ready to make the following facts available to the team?" New facts, chapters, pillars and ownership expansion need developer direction. If started, finish the task once; reuse cached responses only within it and refresh:true after context loss.
|
|
15
|
+
|
|
16
|
+
Default to no write. Keep durable patterns, not debugging history; library-local detail belongs in its README. Resolve disputed behavior with the developer. No change means no Common Ground report. Setup: [.common-ground/START_HERE.md](.common-ground/START_HERE.md).
|
|
17
|
+
`;
|
|
18
|
+
export const policy = `## Common Ground
|
|
19
|
+
|
|
20
|
+
Code is the source of truth. Notes cache durable repository knowledge; matching quotes and hashes establish mechanical consistency, not semantic truth.
|
|
21
|
+
|
|
22
|
+
### Reading and writing invariants
|
|
23
|
+
|
|
24
|
+
- Open relevant source and directory, ancestor, sibling, child and referenced documentation this session. Derive temporary state live. Do not record bugs, debugging history, activity logs, secrets or guesses.
|
|
25
|
+
- Default to no write. Unrelated work and unchanged facts produce no shared knowledge changes. Library-local detail belongs in its README. Each fact holds one coherent, source-backed claim of at most 2,000 characters.
|
|
26
|
+
- Review every existing fact in each required logical chapter before revision. Follow dependency and dependent links, request the review checklist, and verify all required source and documentation. A verification declaration does not prove an agent read or understood a file.
|
|
27
|
+
- Correct verified contradictions in the affected scope quietly, preserving IDs. Merge duplicates and remove superseded claims with explicit reasons and repaired references. Never clean up unrelated responsibilities. Ask if uncertainty blocks the task; otherwise collect it for completion.
|
|
28
|
+
- New facts, chapters, pillars and ownership expansion require developer direction. A new pillar also needs an uncovered standalone responsibility. Approval flags declare developer direction; they never grant autonomous permission or prove human review. Boundary approval does not approve facts. For initial setup, explicit delegation to save/publish may cover verified boundaries and facts within the requested scope; see START_HERE.md. Routine additions still follow the deferred approval workflow below.
|
|
29
|
+
- Chapter paths define non-overlapping ownership. Fact source scopes stay inside ownership; supporting evidence may cite other repository files and is tracked for freshness. Exact evidence, safe paths and valid dependencies remain mandatory.
|
|
30
|
+
- Publish a complete reviewed transaction. Source or registry conflicts reject publication. Unchanged reviews use ignored local receipts; only changed chapters are rewritten. Never bypass required tests based on notes.
|
|
31
|
+
|
|
32
|
+
### Quiet task workflow
|
|
33
|
+
|
|
34
|
+
Use stateless lookup for relevant facts and source paths; default freshness is not checked. After edits, assess actual task-touched paths (including additions and deletions). A matching unchanged source requires no fact review; changed source requires checking affected claims, not automatic revision. Review local/ancestor documentation relevant to the edit and follow semantic connections found in source. Empty touched paths require no review. Use assess --review when a correction needs complete chapters and verification paths. Neither command creates task state or requires finish.
|
|
35
|
+
|
|
36
|
+
Before correcting notes, read this policy and every page of all required chapters. prepare_patch attests reviewedAllFacts:true and the expected revision, then retains unchanged facts. Use prepare_patch without taskId and commit_update for verified corrections. Task contexts remain optional for aggregate reporting and deferred additions. Source or revision conflicts require fresh review. Citation-only repairs may use empty touchedPaths without a tidyId: only evidence may change; the fact ID, statement, sourceScope and dependsOn must remain unchanged. Supply a verified reason, read every required chapter, attest source/documentation verification and the expected revisions. Publication rechecks source and registry conflicts. Use review-plan and review-checklist for the selected chapter; do not invent touched paths.
|
|
37
|
+
|
|
38
|
+
For new facts, start a task when needed and queue them with propose_facts; pending drafts are never authoritative. Finish the developer task and checks, then finish any task context you started. Reuse cached task responses only within that task; refresh:true after context loss. Summarize actual corrections as before → after, why, source links and keep/reverify recommendation. Present additions together and ask "Ready to make the following facts available to the team?" Wait for explicit approval, read proposal-review and required chapters/source, then accept-facts with complete reviews and verification. Drop rejected entries first. Changed drafts need fresh verification and approval. Never require developer JSON review. With no changes or pending questions, give no Common Ground report.
|
|
39
|
+
|
|
40
|
+
Use tidy only for developer-requested cleanup. It returns a local tidyId; the calling agent reads source and submits verified corrections. Common Ground runs no model or autonomous watcher. If unavailable, continue safe task work and report unresolved maintenance; never claim a failed write succeeded. Host tool approval settings remain authoritative.
|
|
41
|
+
|
|
42
|
+
See START_HERE.md for commands and state-specific setup. Keep knowledge.json and managed guidance tracked; local/ is disposable and ignored. Never remove another active task's files.
|
|
43
|
+
`;
|
|
44
|
+
export const startGuide = `# Start Here — Common Ground
|
|
45
|
+
|
|
46
|
+
Common Ground is a framework for shared, Git-backed repository knowledge. Its interfaces are the CLI and local MCP server. Code is the source of truth.
|
|
47
|
+
|
|
48
|
+
## Initial setup: draft, verify, publish
|
|
49
|
+
|
|
50
|
+
1. Run cground init. It creates guidance, MCP configuration and a local candidate map without creating knowledge.json. Use --skip-hook if Git metadata is protected; hook permission failures are advisory and setup continues. The setup report lists completed, skipped, failed and pending steps. Retry safely after fixing a failure; existing registries and bootstrap drafts are preserved. Install the reminder later with cground hook install.
|
|
51
|
+
2. Read source and directory READMEs. Refine .common-ground/local/bootstrap.json into responsibility boundaries and verified facts. detections are raw technology/path signals; responsibilityHints and directory paths are suggestions. Inspect ownershipIncomplete, pathsTruncated, scan.truncated and unclassified samples. Expand or split incomplete boundaries. Follow coveragePrompts for release triggers, versioning, artifacts and publication where detected. Validity and unchanged evidence do not establish complete coverage.
|
|
52
|
+
3. Use cground schema bootstrap and cground bootstrap --help --example. Prepare pillars plus batches of chapterId/facts, then run cground bootstrap PLAN.json --dry-run. This validates the whole transaction without writes and returns source-file counts and a preflight token. JSON commands also accept --stdin.
|
|
53
|
+
4. Establish publication direction from the developer's request. “Initialize” or “generate a map” means draft by default. “Initialize and save/publish the map autonomously” explicitly delegates publication of verified initial boundaries and facts within that scope. Honor an existing delegation without asking again. Otherwise present the exact boundaries and facts in plain language and ask “Ready to make the following facts available to the team?” Wait for approval before publication. A draft-only request never authorizes publication; boundary-only approval never approves facts.
|
|
54
|
+
5. With publication direction, apply the same payload using --approve --preflight TOKEN, run cground check, and summarize what was saved with source links and remaining coverage gaps. Source or payload changes require a fresh dry run and verification; confirm they remain within any delegated scope, or obtain new content approval. Flags declare direction and tokens detect changes; neither proves human review, identity, semantic truth or completeness. Host tool approval settings still apply.
|
|
55
|
+
|
|
56
|
+
The bootstrap path above is self-contained for an empty registry. Before revising existing knowledge, read [POLICY.md](POLICY.md) and every required chapter/source page. For separate setup stages, cground approve creates boundaries only; seed-batch --dry-run and seed-batch --approve --preflight TOKEN populate approved empty chapters with authorized facts. Use command help for exact inputs.
|
|
57
|
+
|
|
58
|
+
A bootstrap-required or not-initialized response has no taskId. Continue the developer task from source. Never fabricate an empty registry or call task assess/propose/finish without a returned taskId. After setup, use lookup; task contexts are optional for deferred additions or aggregate reporting.
|
|
59
|
+
|
|
60
|
+
## My build failed. Where do I go?
|
|
61
|
+
|
|
62
|
+
Follow AGENTS.md for lookup and task-touched assessment. Lookup navigation contains separately labeled ownership/source hints, not facts; freshness is not checked by default. Read source when matches only partly cover a question. --verify checks selected facts and dependencies, not topic completeness or navigation hints.
|
|
63
|
+
|
|
64
|
+
For corrections, assess --review supplies complete chapters and verification paths. Read POLICY.md and every required page before prepare-patch and commit. For deferred additions and task reporting, POLICY.md describes the task_context workflow.
|
|
65
|
+
|
|
66
|
+
## Setup and review commands
|
|
67
|
+
|
|
68
|
+
- cground doctor checks setup; cground refresh-guidance updates managed instructions while preserving surrounding text. A healthy check returns next: null.
|
|
69
|
+
- cground check [TARGET] validates structure, exact evidence and freshness. --all-results includes passing rows; follow nextCursor. --cleanup y creates a developer-requested cleanup plan, not a completed repair.
|
|
70
|
+
- cground review [TARGET] summarizes changes against HEAD. --staged selects the index; --evidence includes changed quotations. Explain before → after, why, sources and a keep/approve/reverify recommendation.
|
|
71
|
+
- cground export refreshes [local/knowledge.md](local/knowledge.md), the ignored reference excluding drafts. Successful knowledge writes refresh it too.
|
|
72
|
+
- cground hook mute/unmute controls advisory reminders. Existing hook managers can call cground hook check.
|
|
73
|
+
|
|
74
|
+
Every command has --help. cground schema OPERATION gives CLI payloads; --both adds MCP arguments. Both MCP profiles expose these workflows through cground. Keep knowledge.json and managed guidance tracked; local/ is ignored. See POLICY.md for maintenance invariants and the framework's docs/pillar-contract.md and docs/quiet-workflow.md for full contracts.
|
|
75
|
+
`;
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Store } from './store.js';
|
|
2
|
+
export declare function installHook(store: Store): Promise<"No Git checkout; run cground init after git init to enable the pre-commit reminder." | "Initialize at the Git root to enable the pre-commit reminder." | "Existing hook manager preserved. Add cground hook check to its pre-commit hook to enable reminders." | "Existing pre-commit hook preserved. Add cground hook check to it to enable reminders." | "Pre-commit reminder installed (advisory). Control notifications with cground hook mute / unmute.">;
|
|
3
|
+
export declare function hookNotifications(store: Store, enabled: boolean): Promise<string>;
|
|
4
|
+
export declare function checkHook(store: Store): Promise<string>;
|
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { promises as fs } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import { execFile } from 'node:child_process';
|
|
5
|
+
import { promisify } from 'node:util';
|
|
6
|
+
import { Store } from './store.js';
|
|
7
|
+
const exec = promisify(execFile);
|
|
8
|
+
async function git(root, args) {
|
|
9
|
+
return (await exec('git', ['-C', root, ...args], { maxBuffer: 16 * 1024 * 1024 })).stdout;
|
|
10
|
+
}
|
|
11
|
+
const hook = `#!/bin/sh
|
|
12
|
+
# Common Ground advisory pre-commit hook
|
|
13
|
+
if command -v cground >/dev/null 2>&1; then
|
|
14
|
+
cground hook check
|
|
15
|
+
elif [ "$(git config --local --get commonGround.hookNotifications)" != "false" ]; then
|
|
16
|
+
printf '%s\\n' 'Common Ground: check unavailable; install cground to review knowledge before sharing.' >&2
|
|
17
|
+
fi
|
|
18
|
+
exit 0
|
|
19
|
+
`;
|
|
20
|
+
export async function installHook(store) {
|
|
21
|
+
let root;
|
|
22
|
+
try {
|
|
23
|
+
root = (await git(store.root, ['rev-parse', '--show-toplevel'])).trim();
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return 'No Git checkout; run cground init after git init to enable the pre-commit reminder.';
|
|
27
|
+
}
|
|
28
|
+
if (path.resolve(root) !== path.resolve(store.root))
|
|
29
|
+
return 'Initialize at the Git root to enable the pre-commit reminder.';
|
|
30
|
+
// Hook managers own their entry point. Never replace their configuration or scripts.
|
|
31
|
+
let custom = '';
|
|
32
|
+
try {
|
|
33
|
+
custom = (await git(root, ['config', '--get', 'core.hooksPath'])).trim();
|
|
34
|
+
}
|
|
35
|
+
catch { }
|
|
36
|
+
if (custom)
|
|
37
|
+
return 'Existing hook manager preserved. Add cground hook check to its pre-commit hook to enable reminders.';
|
|
38
|
+
const target = path.resolve(root, (await git(root, ['rev-parse', '--git-path', 'hooks/pre-commit'])).trim());
|
|
39
|
+
try {
|
|
40
|
+
const stat = await fs.lstat(target);
|
|
41
|
+
if (stat.isSymbolicLink() || !stat.isFile() || await fs.readFile(target, 'utf8') !== hook)
|
|
42
|
+
return 'Existing pre-commit hook preserved. Add cground hook check to it to enable reminders.';
|
|
43
|
+
await fs.chmod(target, 0o755);
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
if (e.code !== 'ENOENT')
|
|
47
|
+
throw e;
|
|
48
|
+
await fs.mkdir(path.dirname(target), { recursive: true });
|
|
49
|
+
await fs.writeFile(target, hook, { flag: 'wx', mode: 0o755 });
|
|
50
|
+
}
|
|
51
|
+
return 'Pre-commit reminder installed (advisory). Control notifications with cground hook mute / unmute.';
|
|
52
|
+
}
|
|
53
|
+
export async function hookNotifications(store, enabled) {
|
|
54
|
+
await git(store.root, ['config', '--local', 'commonGround.hookNotifications', String(enabled)]);
|
|
55
|
+
return `Pre-commit notifications ${enabled ? 'enabled' : 'muted'} for this checkout. Checks remain advisory. Run cground hook ${enabled ? 'mute' : 'unmute'} to ${enabled ? 'mute' : 'restore'} them.`;
|
|
56
|
+
}
|
|
57
|
+
// Export the index so unstaged edits cannot hide stale facts in the proposed commit.
|
|
58
|
+
// No commands from the repository are executed, and no knowledge is rewritten.
|
|
59
|
+
export async function checkHook(store) {
|
|
60
|
+
let muted = false;
|
|
61
|
+
let temporary;
|
|
62
|
+
try {
|
|
63
|
+
try {
|
|
64
|
+
muted = (await git(store.root, ['config', '--local', '--get', 'commonGround.hookNotifications'])).trim() === 'false';
|
|
65
|
+
}
|
|
66
|
+
catch { }
|
|
67
|
+
// Muted notifications have no observable result; avoid exporting and hashing the index.
|
|
68
|
+
if (muted)
|
|
69
|
+
return '';
|
|
70
|
+
const root = (await git(store.root, ['rev-parse', '--show-toplevel'])).trim();
|
|
71
|
+
const staged = (await git(root, ['diff', '--cached', '--name-only', '-z'])).split('\0');
|
|
72
|
+
if (!staged.some(Boolean))
|
|
73
|
+
return '';
|
|
74
|
+
temporary = await fs.mkdtemp(path.join(os.tmpdir(), 'cground-index-'));
|
|
75
|
+
// Disable checkout filters: validation must not run project scripts or fetch LFS data.
|
|
76
|
+
let filters = [];
|
|
77
|
+
try {
|
|
78
|
+
filters = (await git(root, ['config', '--name-only', '--get-regexp', '^filter\\..*\\.(smudge|process|required)$'])).trim().split('\n').filter(Boolean);
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
if (e.code !== 1)
|
|
82
|
+
throw e;
|
|
83
|
+
}
|
|
84
|
+
const overrides = filters.flatMap(key => ['-c', `${key}=${key.endsWith('.required') ? 'false' : ''}`]);
|
|
85
|
+
await git(root, [...overrides, 'checkout-index', '--all', `--prefix=${temporary}/`]);
|
|
86
|
+
const snapshot = new Store(temporary);
|
|
87
|
+
const knowledgePath = '.common-ground/knowledge.json';
|
|
88
|
+
const notes = [];
|
|
89
|
+
// Local receipts are ignored and must never be imported from the index.
|
|
90
|
+
await snapshot.safe('.common-ground/local', true);
|
|
91
|
+
await fs.rm(snapshot.file('local'), { recursive: true, force: true });
|
|
92
|
+
let registry;
|
|
93
|
+
try {
|
|
94
|
+
registry = await snapshot.read();
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
if (e.code !== 'ENOENT')
|
|
98
|
+
throw e;
|
|
99
|
+
return muted ? '' : 'Common Ground: no knowledge.json is staged. Complete setup and review the knowledge before sharing it. Commit allowed.';
|
|
100
|
+
}
|
|
101
|
+
// A no-op review remains valid only if its complete fingerprints match this index.
|
|
102
|
+
const working = new Store(root);
|
|
103
|
+
for (const { key } of snapshot.chapters(registry)) {
|
|
104
|
+
const receipt = `local/review-${key.replace('/', '--')}.json`;
|
|
105
|
+
try {
|
|
106
|
+
await working.safe(`.common-ground/${receipt}`);
|
|
107
|
+
const content = await fs.readFile(working.file(receipt), 'utf8');
|
|
108
|
+
await fs.mkdir(snapshot.file('local'), { recursive: true });
|
|
109
|
+
await fs.writeFile(snapshot.file(receipt), content);
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
if (e.code !== 'ENOENT')
|
|
113
|
+
throw e;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
for (const { key, chapter } of snapshot.chapters(registry)) {
|
|
117
|
+
const state = await snapshot.status(key, registry);
|
|
118
|
+
try {
|
|
119
|
+
await snapshot.validateFacts(chapter);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
notes.push(`${key}: evidence needs review`);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (state.status !== 'evidence-unchanged')
|
|
126
|
+
notes.push(`${key}: ${state.status}`);
|
|
127
|
+
}
|
|
128
|
+
if (staged.includes(knowledgePath))
|
|
129
|
+
notes.push('Ready to make these facts available to the team? Ask your agent for a concise review with cground review --staged before sharing.');
|
|
130
|
+
if (!notes.length || muted)
|
|
131
|
+
return '';
|
|
132
|
+
return `Common Ground — staged knowledge review:\n${notes.map(n => ` ${n}`).join('\n')}\nAsk your agent to verify the affected facts against staged source and summarize what changed. Commit allowed.\nMute reminders: cground hook mute`;
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
return muted ? '' : `Common Ground: staged knowledge check could not complete: ${e.message}\nAsk your agent to summarize and verify knowledge changes before sharing. Commit allowed.`;
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
if (temporary)
|
|
139
|
+
await fs.rm(temporary, { recursive: true, force: true });
|
|
140
|
+
}
|
|
141
|
+
}
|
package/dist/init.d.ts
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { Store } from './store.js';
|
|
2
|
+
import { errorPayload } from './errors.js';
|
|
3
|
+
export { discover } from './discovery.js';
|
|
4
|
+
export { rules } from './guidance.js';
|
|
5
|
+
export declare function initialize(store: Store, options?: {
|
|
6
|
+
skipHook?: boolean;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
hook: string;
|
|
9
|
+
markdown: {
|
|
10
|
+
path: string;
|
|
11
|
+
changed: boolean;
|
|
12
|
+
};
|
|
13
|
+
setup: {
|
|
14
|
+
status: string;
|
|
15
|
+
completed: string[];
|
|
16
|
+
skipped: string[];
|
|
17
|
+
failed: {
|
|
18
|
+
step: string;
|
|
19
|
+
error: ReturnType<typeof errorPayload>;
|
|
20
|
+
}[];
|
|
21
|
+
pending: never[];
|
|
22
|
+
retry: string | null;
|
|
23
|
+
};
|
|
24
|
+
schemaVersion: number;
|
|
25
|
+
requiresDeveloperApproval: boolean;
|
|
26
|
+
scan: {
|
|
27
|
+
inspectedFiles: number;
|
|
28
|
+
inspectedEntries: number;
|
|
29
|
+
truncated: boolean;
|
|
30
|
+
limit: number;
|
|
31
|
+
excludedPaths: string[];
|
|
32
|
+
skipped: {
|
|
33
|
+
path: string;
|
|
34
|
+
reason: string;
|
|
35
|
+
}[];
|
|
36
|
+
skippedCount: number;
|
|
37
|
+
manifestBytesRead: number;
|
|
38
|
+
manifestByteLimit: number;
|
|
39
|
+
};
|
|
40
|
+
pillars: {
|
|
41
|
+
id: string;
|
|
42
|
+
title: string;
|
|
43
|
+
scope: string;
|
|
44
|
+
excludes: string;
|
|
45
|
+
chapters: {
|
|
46
|
+
id: string;
|
|
47
|
+
title: string;
|
|
48
|
+
scope: string;
|
|
49
|
+
excludes: string;
|
|
50
|
+
paths: string[];
|
|
51
|
+
}[];
|
|
52
|
+
}[];
|
|
53
|
+
detections: {
|
|
54
|
+
root: string;
|
|
55
|
+
technologies: string[];
|
|
56
|
+
evidence: string[];
|
|
57
|
+
evidenceCount: number;
|
|
58
|
+
chapterId: string;
|
|
59
|
+
pathHintCount: number;
|
|
60
|
+
pathsTruncated: boolean;
|
|
61
|
+
matchedFileCount: number;
|
|
62
|
+
ownershipCoverage: "incomplete" | "scanned-files";
|
|
63
|
+
rationale: string;
|
|
64
|
+
directoryHints: string[];
|
|
65
|
+
}[];
|
|
66
|
+
detectedProjectCount: number;
|
|
67
|
+
projectsTruncated: boolean;
|
|
68
|
+
responsibilityHints: {
|
|
69
|
+
responsibility: string;
|
|
70
|
+
paths: string[];
|
|
71
|
+
pathCount: number;
|
|
72
|
+
pathsTruncated: boolean;
|
|
73
|
+
rationale: string;
|
|
74
|
+
}[];
|
|
75
|
+
ownershipIncomplete: boolean;
|
|
76
|
+
next: string;
|
|
77
|
+
coveragePrompts: {
|
|
78
|
+
responsibility: string;
|
|
79
|
+
paths: string[];
|
|
80
|
+
pathCount: number;
|
|
81
|
+
pathsTruncated: boolean;
|
|
82
|
+
questions: string[];
|
|
83
|
+
basis: string;
|
|
84
|
+
}[];
|
|
85
|
+
warnings: {
|
|
86
|
+
path: string;
|
|
87
|
+
reason: string;
|
|
88
|
+
}[];
|
|
89
|
+
warningCount: number;
|
|
90
|
+
unclassifiedSample: string[];
|
|
91
|
+
note: string;
|
|
92
|
+
} | {
|
|
93
|
+
hook: string;
|
|
94
|
+
markdown: {
|
|
95
|
+
path: string;
|
|
96
|
+
changed: boolean;
|
|
97
|
+
};
|
|
98
|
+
setup: {
|
|
99
|
+
status: string;
|
|
100
|
+
completed: string[];
|
|
101
|
+
skipped: string[];
|
|
102
|
+
failed: {
|
|
103
|
+
step: string;
|
|
104
|
+
error: ReturnType<typeof errorPayload>;
|
|
105
|
+
}[];
|
|
106
|
+
pending: never[];
|
|
107
|
+
retry: string | null;
|
|
108
|
+
};
|
|
109
|
+
existingRegistry: boolean;
|
|
110
|
+
message: string;
|
|
111
|
+
existingDraft?: undefined;
|
|
112
|
+
proposalPath?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
hook: string;
|
|
115
|
+
markdown: {
|
|
116
|
+
path: string;
|
|
117
|
+
changed: boolean;
|
|
118
|
+
};
|
|
119
|
+
setup: {
|
|
120
|
+
status: string;
|
|
121
|
+
completed: string[];
|
|
122
|
+
skipped: string[];
|
|
123
|
+
failed: {
|
|
124
|
+
step: string;
|
|
125
|
+
error: ReturnType<typeof errorPayload>;
|
|
126
|
+
}[];
|
|
127
|
+
pending: never[];
|
|
128
|
+
retry: string | null;
|
|
129
|
+
};
|
|
130
|
+
existingDraft: boolean;
|
|
131
|
+
proposalPath: string;
|
|
132
|
+
message: string;
|
|
133
|
+
existingRegistry?: undefined;
|
|
134
|
+
} | {
|
|
135
|
+
state: string;
|
|
136
|
+
next: {
|
|
137
|
+
action: string;
|
|
138
|
+
approvalRequired: boolean;
|
|
139
|
+
command: string;
|
|
140
|
+
schema: string;
|
|
141
|
+
guide: string;
|
|
142
|
+
authorization: string;
|
|
143
|
+
};
|
|
144
|
+
hook: string;
|
|
145
|
+
markdown: {
|
|
146
|
+
path: string;
|
|
147
|
+
changed: boolean;
|
|
148
|
+
};
|
|
149
|
+
setup: {
|
|
150
|
+
status: string;
|
|
151
|
+
completed: string[];
|
|
152
|
+
skipped: string[];
|
|
153
|
+
failed: {
|
|
154
|
+
step: string;
|
|
155
|
+
error: ReturnType<typeof errorPayload>;
|
|
156
|
+
}[];
|
|
157
|
+
pending: never[];
|
|
158
|
+
retry: string | null;
|
|
159
|
+
};
|
|
160
|
+
schemaVersion: number;
|
|
161
|
+
requiresDeveloperApproval: boolean;
|
|
162
|
+
scan: {
|
|
163
|
+
inspectedFiles: number;
|
|
164
|
+
inspectedEntries: number;
|
|
165
|
+
truncated: boolean;
|
|
166
|
+
limit: number;
|
|
167
|
+
excludedPaths: string[];
|
|
168
|
+
skipped: {
|
|
169
|
+
path: string;
|
|
170
|
+
reason: string;
|
|
171
|
+
}[];
|
|
172
|
+
skippedCount: number;
|
|
173
|
+
manifestBytesRead: number;
|
|
174
|
+
manifestByteLimit: number;
|
|
175
|
+
};
|
|
176
|
+
pillars: {
|
|
177
|
+
id: string;
|
|
178
|
+
title: string;
|
|
179
|
+
scope: string;
|
|
180
|
+
excludes: string;
|
|
181
|
+
chapters: {
|
|
182
|
+
id: string;
|
|
183
|
+
title: string;
|
|
184
|
+
scope: string;
|
|
185
|
+
excludes: string;
|
|
186
|
+
paths: string[];
|
|
187
|
+
}[];
|
|
188
|
+
}[];
|
|
189
|
+
detections: {
|
|
190
|
+
root: string;
|
|
191
|
+
technologies: string[];
|
|
192
|
+
evidence: string[];
|
|
193
|
+
evidenceCount: number;
|
|
194
|
+
chapterId: string;
|
|
195
|
+
pathHintCount: number;
|
|
196
|
+
pathsTruncated: boolean;
|
|
197
|
+
matchedFileCount: number;
|
|
198
|
+
ownershipCoverage: "incomplete" | "scanned-files";
|
|
199
|
+
rationale: string;
|
|
200
|
+
directoryHints: string[];
|
|
201
|
+
}[];
|
|
202
|
+
detectedProjectCount: number;
|
|
203
|
+
projectsTruncated: boolean;
|
|
204
|
+
responsibilityHints: {
|
|
205
|
+
responsibility: string;
|
|
206
|
+
paths: string[];
|
|
207
|
+
pathCount: number;
|
|
208
|
+
pathsTruncated: boolean;
|
|
209
|
+
rationale: string;
|
|
210
|
+
}[];
|
|
211
|
+
ownershipIncomplete: boolean;
|
|
212
|
+
coveragePrompts: {
|
|
213
|
+
responsibility: string;
|
|
214
|
+
paths: string[];
|
|
215
|
+
pathCount: number;
|
|
216
|
+
pathsTruncated: boolean;
|
|
217
|
+
questions: string[];
|
|
218
|
+
basis: string;
|
|
219
|
+
}[];
|
|
220
|
+
warnings: {
|
|
221
|
+
path: string;
|
|
222
|
+
reason: string;
|
|
223
|
+
}[];
|
|
224
|
+
warningCount: number;
|
|
225
|
+
unclassifiedSample: string[];
|
|
226
|
+
note: string;
|
|
227
|
+
} | {
|
|
228
|
+
state: string;
|
|
229
|
+
next: {
|
|
230
|
+
action: string;
|
|
231
|
+
approvalRequired: boolean;
|
|
232
|
+
command: string;
|
|
233
|
+
schema: string;
|
|
234
|
+
guide: string;
|
|
235
|
+
authorization: string;
|
|
236
|
+
};
|
|
237
|
+
hook: string;
|
|
238
|
+
markdown: {
|
|
239
|
+
path: string;
|
|
240
|
+
changed: boolean;
|
|
241
|
+
};
|
|
242
|
+
setup: {
|
|
243
|
+
status: string;
|
|
244
|
+
completed: string[];
|
|
245
|
+
skipped: string[];
|
|
246
|
+
failed: {
|
|
247
|
+
step: string;
|
|
248
|
+
error: ReturnType<typeof errorPayload>;
|
|
249
|
+
}[];
|
|
250
|
+
pending: never[];
|
|
251
|
+
retry: string | null;
|
|
252
|
+
};
|
|
253
|
+
existingRegistry: boolean;
|
|
254
|
+
message: string;
|
|
255
|
+
existingDraft?: undefined;
|
|
256
|
+
proposalPath?: undefined;
|
|
257
|
+
} | {
|
|
258
|
+
state: string;
|
|
259
|
+
next: {
|
|
260
|
+
action: string;
|
|
261
|
+
approvalRequired: boolean;
|
|
262
|
+
command: string;
|
|
263
|
+
schema: string;
|
|
264
|
+
guide: string;
|
|
265
|
+
authorization: string;
|
|
266
|
+
};
|
|
267
|
+
hook: string;
|
|
268
|
+
markdown: {
|
|
269
|
+
path: string;
|
|
270
|
+
changed: boolean;
|
|
271
|
+
};
|
|
272
|
+
setup: {
|
|
273
|
+
status: string;
|
|
274
|
+
completed: string[];
|
|
275
|
+
skipped: string[];
|
|
276
|
+
failed: {
|
|
277
|
+
step: string;
|
|
278
|
+
error: ReturnType<typeof errorPayload>;
|
|
279
|
+
}[];
|
|
280
|
+
pending: never[];
|
|
281
|
+
retry: string | null;
|
|
282
|
+
};
|
|
283
|
+
existingDraft: boolean;
|
|
284
|
+
proposalPath: string;
|
|
285
|
+
message: string;
|
|
286
|
+
existingRegistry?: undefined;
|
|
287
|
+
}>;
|
|
288
|
+
export declare function guidanceStatus(store: Store): Promise<{
|
|
289
|
+
installedVersion: string;
|
|
290
|
+
basis: string;
|
|
291
|
+
status: string;
|
|
292
|
+
files: Record<string, string>;
|
|
293
|
+
next: string | null;
|
|
294
|
+
}>;
|
|
295
|
+
export declare function refreshGuidance(store: Store): Promise<{
|
|
296
|
+
installedVersion: string;
|
|
297
|
+
basis: string;
|
|
298
|
+
status: string;
|
|
299
|
+
files: Record<string, string>;
|
|
300
|
+
next: string | null;
|
|
301
|
+
writesKnowledge: boolean;
|
|
302
|
+
changedFiles: string[];
|
|
303
|
+
unchangedFiles: string[];
|
|
304
|
+
}>;
|