@cleocode/contracts 2026.9.8 → 2026.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/acceptance-gate.test.js +242 -1
- package/dist/__tests__/acceptance-gate.test.js.map +1 -1
- package/dist/__tests__/evidence-atom-schema.test.js +17 -14
- package/dist/__tests__/evidence-atom-schema.test.js.map +1 -1
- package/dist/__tests__/memory-wire-shapes.test.js.map +1 -1
- package/dist/__tests__/operations-registry.test.js +18 -0
- package/dist/__tests__/operations-registry.test.js.map +1 -1
- package/dist/acceptance-gate-schema.d.ts +60 -2
- package/dist/acceptance-gate-schema.d.ts.map +1 -1
- package/dist/acceptance-gate-schema.js +273 -1
- package/dist/acceptance-gate-schema.js.map +1 -1
- package/dist/acceptance-gate.d.ts +122 -11
- package/dist/acceptance-gate.d.ts.map +1 -1
- package/dist/acceptance-gate.js +3 -3
- package/dist/audit.d.ts +71 -2
- package/dist/audit.d.ts.map +1 -1
- package/dist/backup-manifest.d.ts +80 -0
- package/dist/backup-manifest.d.ts.map +1 -1
- package/dist/caamp-markers.d.ts +20 -0
- package/dist/caamp-markers.d.ts.map +1 -1
- package/dist/capabilities.d.ts +282 -0
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/changesets.d.ts +4 -4
- package/dist/code-symbol.d.ts +33 -0
- package/dist/code-symbol.d.ts.map +1 -1
- package/dist/daemon/health.d.ts +3 -3
- package/dist/data-accessor.d.ts +15 -0
- package/dist/data-accessor.d.ts.map +1 -1
- package/dist/data-accessor.js.map +1 -1
- package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.js +19 -1
- package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.js.map +1 -1
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +684 -3
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/docs-taxonomy.d.ts +25 -0
- package/dist/docs-taxonomy.d.ts.map +1 -1
- package/dist/docs-taxonomy.js.map +1 -1
- package/dist/evidence-atom-schema.d.ts +7 -6
- package/dist/evidence-atom-schema.d.ts.map +1 -1
- package/dist/evidence-atom-schema.js +10 -9
- package/dist/evidence-atom-schema.js.map +1 -1
- package/dist/graph.d.ts +283 -2
- package/dist/graph.d.ts.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/invariants/adr-070-orchestration.d.ts.map +1 -1
- package/dist/invariants/adr-070-orchestration.js +1 -1
- package/dist/invariants/adr-070-orchestration.js.map +1 -1
- package/dist/invariants/adr-073-saga.js +2 -2
- package/dist/invariants/adr-073-saga.js.map +1 -1
- package/dist/jobs.d.ts +329 -3
- package/dist/jobs.d.ts.map +1 -1
- package/dist/knowledge-health.d.ts +695 -0
- package/dist/knowledge-health.d.ts.map +1 -0
- package/dist/knowledge-health.js +8 -0
- package/dist/knowledge-health.js.map +1 -0
- package/dist/llm/catalog-schema.d.ts +4 -4
- package/dist/memory/observe.d.ts +4 -2
- package/dist/memory/observe.d.ts.map +1 -1
- package/dist/memory/search.d.ts +4 -0
- package/dist/memory/search.d.ts.map +1 -1
- package/dist/nexus-living-brain-ops.d.ts +28 -3
- package/dist/nexus-living-brain-ops.d.ts.map +1 -1
- package/dist/nexus-tasks-bridge-ops.d.ts +11 -0
- package/dist/nexus-tasks-bridge-ops.d.ts.map +1 -1
- package/dist/operations/admin.d.ts +10 -4
- package/dist/operations/admin.d.ts.map +1 -1
- package/dist/operations/docs.d.ts +138 -0
- package/dist/operations/docs.d.ts.map +1 -1
- package/dist/operations/docs.js +47 -0
- package/dist/operations/docs.js.map +1 -1
- package/dist/operations/focus.d.ts +7 -0
- package/dist/operations/focus.d.ts.map +1 -1
- package/dist/operations/nexus.d.ts +7 -2
- package/dist/operations/nexus.d.ts.map +1 -1
- package/dist/operations/output-contracts-data.d.ts.map +1 -1
- package/dist/operations/output-contracts-data.js +31 -3
- package/dist/operations/output-contracts-data.js.map +1 -1
- package/dist/operations/research.d.ts +33 -0
- package/dist/operations/research.d.ts.map +1 -1
- package/dist/operations/tasks.d.ts +107 -4
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/tasks.js +5 -0
- package/dist/operations/tasks.js.map +1 -1
- package/dist/package-artifact.d.ts +112 -0
- package/dist/package-artifact.d.ts.map +1 -0
- package/dist/package-artifact.js +8 -0
- package/dist/package-artifact.js.map +1 -0
- package/dist/release/evidence-atoms.d.ts +10 -0
- package/dist/release/evidence-atoms.d.ts.map +1 -1
- package/dist/release/evidence-atoms.js +6 -0
- package/dist/release/evidence-atoms.js.map +1 -1
- package/dist/release/plan.d.ts +6 -6
- package/dist/resource-governor.d.ts +114 -0
- package/dist/resource-governor.d.ts.map +1 -1
- package/dist/resource-governor.js.map +1 -1
- package/dist/supervisor-ipc/messages.d.ts +6 -6
- package/dist/task-record.d.ts +25 -4
- package/dist/task-record.d.ts.map +1 -1
- package/dist/task.d.ts +55 -36
- package/dist/task.d.ts.map +1 -1
- package/dist/task.js.map +1 -1
- package/dist/tasks/archive.d.ts +3 -3
- package/dist/templates/manifest.d.ts +1 -1
- package/dist/workgraph.d.ts +5 -3
- package/dist/workgraph.d.ts.map +1 -1
- package/dist/workgraph.js +19 -0
- package/dist/workgraph.js.map +1 -1
- package/package.json +2 -2
- package/schemas/gate-result.schema.json +350 -1
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/__tests__/acceptance-gate.test.ts +282 -1
- package/src/__tests__/evidence-atom-schema.test.ts +17 -14
- package/src/__tests__/memory-wire-shapes.test.ts +2 -0
- package/src/__tests__/operations-registry.test.ts +26 -0
- package/src/acceptance-gate-schema.ts +320 -14
- package/src/acceptance-gate.ts +133 -11
- package/src/audit.ts +72 -2
- package/src/backup-manifest.ts +88 -0
- package/src/caamp-markers.ts +22 -0
- package/src/capabilities.ts +311 -0
- package/src/code-symbol.ts +37 -0
- package/src/data-accessor.ts +16 -0
- package/src/dispatch/__tests__/tasks-gateway-crud-ops.test.ts +31 -1
- package/src/dispatch/operations-registry.ts +689 -3
- package/src/docs-taxonomy.ts +26 -0
- package/src/evidence-atom-schema.ts +10 -9
- package/src/graph.ts +326 -2
- package/src/index.ts +43 -1
- package/src/invariants/adr-070-orchestration.ts +2 -1
- package/src/invariants/adr-073-saga.ts +2 -2
- package/src/jobs.ts +382 -3
- package/src/knowledge-health.ts +748 -0
- package/src/memory/observe.ts +4 -2
- package/src/memory/search.ts +4 -0
- package/src/nexus-living-brain-ops.ts +34 -3
- package/src/nexus-tasks-bridge-ops.ts +12 -0
- package/src/operations/admin.ts +11 -4
- package/src/operations/docs.ts +153 -0
- package/src/operations/focus.ts +11 -0
- package/src/operations/nexus.ts +7 -1
- package/src/operations/output-contracts-data.ts +33 -3
- package/src/operations/research.ts +36 -0
- package/src/operations/tasks.ts +116 -4
- package/src/package-artifact.ts +127 -0
- package/src/release/evidence-atoms.ts +6 -0
- package/src/resource-governor.ts +132 -0
- package/src/task-record.ts +27 -4
- package/src/task.ts +58 -36
- package/src/workgraph.ts +19 -0
package/src/docs-taxonomy.ts
CHANGED
|
@@ -710,6 +710,32 @@ function requireString(
|
|
|
710
710
|
return value;
|
|
711
711
|
}
|
|
712
712
|
|
|
713
|
+
/**
|
|
714
|
+
* Most specific configured ownership rule for a repository-relative document.
|
|
715
|
+
*
|
|
716
|
+
* @remarks
|
|
717
|
+
* Route eligibility does not prove canonical storage or publication provenance.
|
|
718
|
+
* A nested prohibition takes precedence over a broader permitted mirror.
|
|
719
|
+
*
|
|
720
|
+
* @example
|
|
721
|
+
* ```typescript
|
|
722
|
+
* const policy: CanonDocPathPolicy = {
|
|
723
|
+
* docKind: 'research', matchedPath: '.cleo/research/',
|
|
724
|
+
* rawMdAllowed: false, source: 'raw-path',
|
|
725
|
+
* };
|
|
726
|
+
* ```
|
|
727
|
+
*/
|
|
728
|
+
export interface CanonDocPathPolicy {
|
|
729
|
+
/** Kind declaring the selected directory rule. */
|
|
730
|
+
readonly docKind: string;
|
|
731
|
+
/** Normalized directory prefix with final slash; empty for the project root. */
|
|
732
|
+
readonly matchedPath: string;
|
|
733
|
+
/** Whether this rule permits raw markdown at the selected location. */
|
|
734
|
+
readonly rawMdAllowed: boolean;
|
|
735
|
+
/** Explicit raw path or permitted publication mirror that owns the path. */
|
|
736
|
+
readonly source: 'raw-path' | 'published-mirror';
|
|
737
|
+
}
|
|
738
|
+
|
|
713
739
|
/**
|
|
714
740
|
* Build a best-effort example slug from a metadata entry's pattern.
|
|
715
741
|
*
|
|
@@ -193,10 +193,9 @@ export const decisionAtomSchema = z.object({
|
|
|
193
193
|
});
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
|
-
* `pr:<number>` atom — references
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* `implemented` because the merge commit IS the landing artifact.
|
|
196
|
+
* `pr:<number>` atom — references merged PR provenance. Contextual validation
|
|
197
|
+
* checks task relationship and changed artifacts. Implementation also needs
|
|
198
|
+
* inspected file evidence; testing and review require actual result atoms.
|
|
200
199
|
*
|
|
201
200
|
* Format: `pr:<positive integer>` (e.g. `pr:357`).
|
|
202
201
|
*
|
|
@@ -449,8 +448,10 @@ export interface GateEvidenceRequirement {
|
|
|
449
448
|
* - `[decision, files]` — decision-only task: brain_decisions row +
|
|
450
449
|
* research-note file (T1875).
|
|
451
450
|
* - `[decision, note]` — decision-only task without research note.
|
|
452
|
-
* - `[pr]`
|
|
453
|
-
*
|
|
451
|
+
* - `[pr, files]` — merged-PR provenance with inspected artifacts.
|
|
452
|
+
*
|
|
453
|
+
* PR merge status and generic CI success do not prove tests or review for
|
|
454
|
+
* the task. Those gates require their own verified result atoms (T12254).
|
|
454
455
|
*
|
|
455
456
|
* ## Why is `qaPassed` listed as `['tool']` not `['tool', 'tool']`?
|
|
456
457
|
*
|
|
@@ -473,11 +474,11 @@ export const GATE_EVIDENCE_REQUIREMENTS: Readonly<
|
|
|
473
474
|
['commit', 'note'],
|
|
474
475
|
['decision', 'files'],
|
|
475
476
|
['decision', 'note'],
|
|
476
|
-
['pr'],
|
|
477
|
+
['pr', 'files'],
|
|
477
478
|
],
|
|
478
479
|
},
|
|
479
|
-
testsPassed: { oneOf: [['test-run'], ['tool']
|
|
480
|
-
qaPassed: { oneOf: [['tool']
|
|
480
|
+
testsPassed: { oneOf: [['test-run'], ['tool']] },
|
|
481
|
+
qaPassed: { oneOf: [['tool']] },
|
|
481
482
|
documented: { oneOf: [['files'], ['url']] },
|
|
482
483
|
securityPassed: { oneOf: [['tool'], ['note']] },
|
|
483
484
|
cleanupDone: { oneOf: [['note']] },
|
package/src/graph.ts
CHANGED
|
@@ -362,6 +362,328 @@ export interface GraphRelation {
|
|
|
362
362
|
reason?: string;
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
+
/** Insert row shape for nexus_nodes. */
|
|
366
|
+
export interface NexusNodeInsertRow {
|
|
367
|
+
id: string;
|
|
368
|
+
kind: GraphNodeKind;
|
|
369
|
+
label: string;
|
|
370
|
+
name: string | null;
|
|
371
|
+
filePath: string | null;
|
|
372
|
+
startLine: number | null;
|
|
373
|
+
endLine: number | null;
|
|
374
|
+
language: string | null;
|
|
375
|
+
isExported: boolean;
|
|
376
|
+
parentId: string | null;
|
|
377
|
+
parametersJson: string | null;
|
|
378
|
+
returnType: string | null;
|
|
379
|
+
docSummary: string | null;
|
|
380
|
+
communityId: string | null;
|
|
381
|
+
metaJson: string | null;
|
|
382
|
+
indexedAt: string;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/** Insert row shape for nexus_relations. */
|
|
386
|
+
export interface NexusRelationInsertRow {
|
|
387
|
+
id: string;
|
|
388
|
+
sourceId: string;
|
|
389
|
+
targetId: string;
|
|
390
|
+
type: GraphRelationType;
|
|
391
|
+
confidence: number;
|
|
392
|
+
reason: string | null;
|
|
393
|
+
step: number | null;
|
|
394
|
+
indexedAt: string;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Role supported by a file's recorded classification evidence.
|
|
399
|
+
* @remarks Unknown files retain potential executable gaps. Generated data is not
|
|
400
|
+
* generated executable code; executable files retain their code capabilities.
|
|
401
|
+
* @example
|
|
402
|
+
* ```ts
|
|
403
|
+
* const role: GraphFileRole = 'documentation';
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
export type GraphFileRole =
|
|
407
|
+
| 'executable'
|
|
408
|
+
| 'sql'
|
|
409
|
+
| 'documentation'
|
|
410
|
+
| 'configuration'
|
|
411
|
+
| 'schema'
|
|
412
|
+
| 'generated-data'
|
|
413
|
+
| 'data'
|
|
414
|
+
| 'asset'
|
|
415
|
+
| 'unknown';
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* One independently requested indexing capability, not a runtime completeness claim.
|
|
419
|
+
* @remarks Evidence capabilities retain available file content and its positively
|
|
420
|
+
* identified role. They do not validate scientific authority, execute configuration,
|
|
421
|
+
* or establish complete symbol/reference resolution. SQL capabilities are separate.
|
|
422
|
+
* @example
|
|
423
|
+
* ```ts
|
|
424
|
+
* const requested: GraphAnalysisCapability[] = ['file-evidence', 'call-references'];
|
|
425
|
+
* ```
|
|
426
|
+
*/
|
|
427
|
+
export type GraphAnalysisCapability =
|
|
428
|
+
| 'file-evidence'
|
|
429
|
+
| 'documentary-evidence'
|
|
430
|
+
| 'configuration-evidence'
|
|
431
|
+
| 'schema-evidence'
|
|
432
|
+
| 'data-evidence'
|
|
433
|
+
| 'resource-evidence'
|
|
434
|
+
| 'declarations'
|
|
435
|
+
| 'imports'
|
|
436
|
+
| 'call-references'
|
|
437
|
+
| 'access-references'
|
|
438
|
+
| 'type-heritage'
|
|
439
|
+
| 'sql-schema-objects'
|
|
440
|
+
| 'sql-migrations'
|
|
441
|
+
| 'sql-triggers'
|
|
442
|
+
| 'sql-constraints'
|
|
443
|
+
| 'sql-literal-references'
|
|
444
|
+
| 'sql-dynamic-references';
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Provenance for assigning a file role; recognition is not authority.
|
|
448
|
+
* @remarks Path-only recognition cannot prove an unknown file is non-executable.
|
|
449
|
+
* @example
|
|
450
|
+
* ```ts
|
|
451
|
+
* const classification: GraphFileClassification = {
|
|
452
|
+
* basis: 'path-and-content', reason: 'PNG path and binary signature',
|
|
453
|
+
* };
|
|
454
|
+
* ```
|
|
455
|
+
*/
|
|
456
|
+
export interface GraphFileClassification {
|
|
457
|
+
/** Inputs that positively establish the recorded role, or unknown when unclassified. */
|
|
458
|
+
basis: 'path' | 'content' | 'path-and-content' | 'unknown';
|
|
459
|
+
/** Human-readable observation; never an inferred scientific or policy authority. */
|
|
460
|
+
reason: string;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Capability-specific observations for an existing per-file index report.
|
|
465
|
+
* @remarks Completed is a subset of requested and records performed extraction or
|
|
466
|
+
* available evidence, not the absence of unresolved references. Static limitations
|
|
467
|
+
* and uncompleted capabilities must survive compact reporting. Legacy reports may
|
|
468
|
+
* lack this object and cannot retrospectively be declared capability-complete.
|
|
469
|
+
* @example
|
|
470
|
+
* ```ts
|
|
471
|
+
* const capabilities: GraphFileCapabilityCoverage = {
|
|
472
|
+
* role: 'documentation',
|
|
473
|
+
* classification: { basis: 'path', reason: 'Documentary Markdown extension' },
|
|
474
|
+
* requested: ['file-evidence', 'documentary-evidence'],
|
|
475
|
+
* completed: ['file-evidence', 'documentary-evidence'],
|
|
476
|
+
* limitations: [],
|
|
477
|
+
* };
|
|
478
|
+
* ```
|
|
479
|
+
*/
|
|
480
|
+
export interface GraphFileCapabilityCoverage {
|
|
481
|
+
/** Actual role supported by classification provenance. */
|
|
482
|
+
role: GraphFileRole;
|
|
483
|
+
/** Evidence explaining this role and its limits. */
|
|
484
|
+
classification: GraphFileClassification;
|
|
485
|
+
/** Capabilities required for this role in the assessed scope. */
|
|
486
|
+
requested: GraphAnalysisCapability[];
|
|
487
|
+
/** Requested capabilities whose processing actually completed. */
|
|
488
|
+
completed: GraphAnalysisCapability[];
|
|
489
|
+
/** Explicit limits, including unresolved dynamic/static analysis. */
|
|
490
|
+
limitations: string[];
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/** Observed outcome for one file or explicitly excluded directory during indexing. */
|
|
494
|
+
export interface GraphIndexFileReport {
|
|
495
|
+
/** Path relative to the assessed source root. */
|
|
496
|
+
path: string;
|
|
497
|
+
/**
|
|
498
|
+
* Processing outcome relative to requested capabilities; not a universal caller verdict.
|
|
499
|
+
* Unsupported or oversized executable capabilities remain gaps.
|
|
500
|
+
*/
|
|
501
|
+
status: 'analyzed' | 'excluded' | 'unsupported' | 'oversized' | 'failed';
|
|
502
|
+
/**
|
|
503
|
+
* Role-specific capability evidence from current producers.
|
|
504
|
+
* @defaultValue undefined on legacy reports without capability provenance.
|
|
505
|
+
*/
|
|
506
|
+
capabilities?: GraphFileCapabilityCoverage;
|
|
507
|
+
/** Explanation for skipped or failed extraction. */
|
|
508
|
+
reason?: string;
|
|
509
|
+
/** Filesystem modification time captured before parsing. */
|
|
510
|
+
mtimeMs?: number;
|
|
511
|
+
/** SHA-256 of the bytes analyzed; detects edits even when filesystem metadata is preserved. */
|
|
512
|
+
contentHash?: string;
|
|
513
|
+
/** File size captured before parsing. */
|
|
514
|
+
size?: number;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/** Original-source range; native parser indexes count UTF-16 code units, not UTF-8 bytes. */
|
|
518
|
+
export interface GraphSourceSpan {
|
|
519
|
+
/** Inclusive start offset in original source. */
|
|
520
|
+
startIndex: number;
|
|
521
|
+
/** Exclusive end offset in original source. */
|
|
522
|
+
endIndex: number;
|
|
523
|
+
/** One-based start line. */
|
|
524
|
+
startLine: number;
|
|
525
|
+
/** One-based end line. */
|
|
526
|
+
endLine: number;
|
|
527
|
+
/** Zero-based start column in UTF-16 units. */
|
|
528
|
+
startColumn: number;
|
|
529
|
+
/** Zero-based end column in UTF-16 units. */
|
|
530
|
+
endColumn: number;
|
|
531
|
+
/** Explicit index encoding prevents byte/character confusion. */
|
|
532
|
+
offsetEncoding: 'utf16';
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/** A binding introduced by syntax in an explicitly supported lexical model. */
|
|
536
|
+
export interface GraphLexicalBinding {
|
|
537
|
+
/** Stable declaration identity, distinct from its visible name. */
|
|
538
|
+
id: string;
|
|
539
|
+
/** Identifier visible in the declaring scope. */
|
|
540
|
+
name: string;
|
|
541
|
+
/** Scope that owns the binding. */
|
|
542
|
+
scopeId: string;
|
|
543
|
+
/** Value binding category; type-only imports remain explicitly marked. */
|
|
544
|
+
kind: 'function' | 'class' | 'local' | 'parameter' | 'catch' | 'import';
|
|
545
|
+
/** Original declaration range. */
|
|
546
|
+
span: GraphSourceSpan;
|
|
547
|
+
/** Callable/class target established by syntax, absent for unknown local values. */
|
|
548
|
+
targetId?: string;
|
|
549
|
+
/** Literal import source, before repository resolution. */
|
|
550
|
+
importSource?: string;
|
|
551
|
+
/** Imported name; '*' identifies a namespace import. */
|
|
552
|
+
importedName?: string;
|
|
553
|
+
/** True when this declaration cannot provide a runtime value. */
|
|
554
|
+
typeOnly?: boolean;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/** One scope in a per-file lexical model, qualified by its containing scopes. */
|
|
558
|
+
export interface GraphLexicalScope {
|
|
559
|
+
/** Unique scope identity. */
|
|
560
|
+
id: string;
|
|
561
|
+
/** Lexical parent; omitted only for the module. */
|
|
562
|
+
parentId?: string;
|
|
563
|
+
/** Scope semantics used for shadowing and var hoisting. */
|
|
564
|
+
kind: 'module' | 'function' | 'class' | 'block' | 'catch';
|
|
565
|
+
/** Nearest declared callable/class identity for reference ownership. */
|
|
566
|
+
ownerId: string;
|
|
567
|
+
/** Original syntax range. */
|
|
568
|
+
span: GraphSourceSpan;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/** Lexical lookup evidence; an unknown local value is never a global-name fallback. */
|
|
572
|
+
export interface GraphLexicalResolution {
|
|
573
|
+
/** Outcome before repository import/member resolution. */
|
|
574
|
+
kind: 'resolved' | 'import' | 'shadowed' | 'ambiguous' | 'unbound';
|
|
575
|
+
/** Binding candidates in the nearest declaring scope, without arbitrary selection. */
|
|
576
|
+
bindings: GraphLexicalBinding[];
|
|
577
|
+
/** Why these bindings or their absence produced the outcome. */
|
|
578
|
+
reason: string;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/** An unresolved static reference retained with its available lexical and source evidence. */
|
|
582
|
+
export interface GraphIndexReferenceReport {
|
|
583
|
+
/** Explicit extraction limitation; this record is not a resolved graph relationship. */
|
|
584
|
+
kind: 'unmodeled-source' | 'ambiguous' | 'external' | 'dynamic' | 'shadowed' | 'unresolved';
|
|
585
|
+
/** Analyzed source file containing the reference. */
|
|
586
|
+
filePath: string;
|
|
587
|
+
/** Enclosing qualified scope identifier extracted from original syntax. */
|
|
588
|
+
sourceId: string;
|
|
589
|
+
/** Known target, absent when syntax cannot establish one. */
|
|
590
|
+
targetId?: string;
|
|
591
|
+
/** Callee or member name retained for independent source inspection. */
|
|
592
|
+
targetName: string;
|
|
593
|
+
/** The kind of static relationship omitted from the published graph. */
|
|
594
|
+
relationship: 'calls' | 'accesses';
|
|
595
|
+
/** Extraction and resolution provenance from the attempted relationship. */
|
|
596
|
+
reason: string;
|
|
597
|
+
/** Original reference range; absent on historical or unsupported-language reports. */
|
|
598
|
+
span?: GraphSourceSpan;
|
|
599
|
+
/** Candidate identities retained without asserting an authoritative target. */
|
|
600
|
+
candidateIds?: string[];
|
|
601
|
+
/** Source-content generation tying reference evidence to analyzed bytes. */
|
|
602
|
+
generation?: string;
|
|
603
|
+
/** Preallocated publication identity; absent for standalone or historical extraction. */
|
|
604
|
+
publicationGeneration?: string;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/** One explicitly selected source root, without implying complete file or caller coverage. */
|
|
608
|
+
export interface GraphSourceRoot {
|
|
609
|
+
/** Absolute normalized requested location, retained even when inaccessible. */
|
|
610
|
+
readonly requestedPath: string;
|
|
611
|
+
/** Real filesystem location; null when canonical ownership could not be observed. */
|
|
612
|
+
readonly canonicalPath: string | null;
|
|
613
|
+
/** Forward-slash prefix relative to the graph source root; empty for the root itself. */
|
|
614
|
+
readonly graphPrefix: string;
|
|
615
|
+
/** Whether the caller explicitly included this repository below the graph source root. */
|
|
616
|
+
readonly explicitlyIncluded: boolean;
|
|
617
|
+
/** Git HEAD observed at this root; null is never interpreted as a known revision. */
|
|
618
|
+
readonly revision: string | null;
|
|
619
|
+
/** Outcome of root/revision observation, distinct from file-analysis coverage. */
|
|
620
|
+
readonly status: 'available' | 'unversioned' | 'missing' | 'failed' | 'pending';
|
|
621
|
+
/** Diagnostic failures or limitations that must survive compact root rendering. */
|
|
622
|
+
readonly diagnostics: readonly string[];
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/** Immutable provenance of explicitly owned roots under a stable parent project identity. */
|
|
626
|
+
export interface GraphSourceRootAssessment {
|
|
627
|
+
/** Existing project identity supplied by the caller, never derived from Git roots. */
|
|
628
|
+
readonly projectId: string;
|
|
629
|
+
/** Absolute parent project location; canonicalized when it exists. */
|
|
630
|
+
readonly projectRoot: string;
|
|
631
|
+
/** Absolute graph source location; canonicalized when it exists. */
|
|
632
|
+
readonly sourceRoot: string;
|
|
633
|
+
/** Observation start time in ISO-8601 form. */
|
|
634
|
+
readonly assessedAt: string;
|
|
635
|
+
/** Source root followed by explicitly selected repository roots; no implicit nested discovery. */
|
|
636
|
+
readonly roots: readonly GraphSourceRoot[];
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/** Explicit source ownership and bounded revision-assessment input. */
|
|
640
|
+
export interface GraphSourceRootRequest {
|
|
641
|
+
/** Stable existing parent project identity. */
|
|
642
|
+
readonly projectId: string;
|
|
643
|
+
/** Parent project location; independent of repository ownership. */
|
|
644
|
+
readonly projectRoot: string;
|
|
645
|
+
/** Explicit graph source location; defaults to the parent project location. */
|
|
646
|
+
readonly sourceRoot?: string;
|
|
647
|
+
/** Repository paths relative to the source root; escaping or aliased ownership is invalid. */
|
|
648
|
+
readonly includedRepositories?: readonly string[];
|
|
649
|
+
/** Absolute epoch-millisecond deadline shared across every root; defaults to two seconds. */
|
|
650
|
+
readonly deadline?: number;
|
|
651
|
+
/** Caller cancellation; cancellation rejects instead of reporting successful observation. */
|
|
652
|
+
readonly signal?: AbortSignal;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/** Source provenance persisted with a complete published graph generation. */
|
|
656
|
+
export interface GraphIndexAssessment {
|
|
657
|
+
/** Explicit parent identity and per-root revision observations; absent on historical indexes. */
|
|
658
|
+
sourceRoots?: GraphSourceRootAssessment;
|
|
659
|
+
/** Immutable publication identity allocated before extraction; absent on historical indexes. */
|
|
660
|
+
generation?: string;
|
|
661
|
+
/** Unmodeled AST scopes remain explicit limitations instead of fabricated declarations. */
|
|
662
|
+
references?: GraphIndexReferenceReport[];
|
|
663
|
+
/** Explicit nested repository/worktree scope retained for subsequent rebuilds. */
|
|
664
|
+
includedRepositories?: string[];
|
|
665
|
+
/** Canonical root whose relative file paths this graph describes. */
|
|
666
|
+
sourceRoot: string;
|
|
667
|
+
/** Git revision captured at assessment; null when no revision is available. */
|
|
668
|
+
assessedRevision: string | null;
|
|
669
|
+
/** ISO timestamp of the assessment. */
|
|
670
|
+
assessedAt: string;
|
|
671
|
+
/** Explicit extraction/exclusion outcomes, including partial coverage. */
|
|
672
|
+
files: GraphIndexFileReport[];
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/** Validated rows staged before an atomic graph publication. */
|
|
676
|
+
export interface GraphPublicationRows {
|
|
677
|
+
/** Immutable publication identity shared by anonymous symbols, rows and assessment. */
|
|
678
|
+
generation?: string;
|
|
679
|
+
/** Source provenance and coverage belonging to this generation. */
|
|
680
|
+
assessment?: GraphIndexAssessment;
|
|
681
|
+
/** Complete replacement node generation. */
|
|
682
|
+
nodes: NexusNodeInsertRow[];
|
|
683
|
+
/** Complete replacement relationship generation. */
|
|
684
|
+
relations: NexusRelationInsertRow[];
|
|
685
|
+
}
|
|
686
|
+
|
|
365
687
|
// ---------------------------------------------------------------------------
|
|
366
688
|
// Impact analysis result
|
|
367
689
|
// ---------------------------------------------------------------------------
|
|
@@ -385,12 +707,14 @@ export interface ImpactResult {
|
|
|
385
707
|
/**
|
|
386
708
|
* Overall risk classification based on the number and type of affected nodes.
|
|
387
709
|
*
|
|
388
|
-
* - `
|
|
710
|
+
* - `unknown`: target missing or evidence insufficient
|
|
711
|
+
* - `none`: assessed target with no detected static dependants
|
|
712
|
+
* - `low`: 1–3 direct dependants, no cross-module spread
|
|
389
713
|
* - `medium`: 4–9 direct dependants, or limited cross-module spread
|
|
390
714
|
* - `high`: 10+ direct dependants, or significant cross-module spread
|
|
391
715
|
* - `critical`: Exported symbol with high cross-module usage
|
|
392
716
|
*/
|
|
393
|
-
riskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
717
|
+
riskLevel: 'unknown' | 'none' | 'low' | 'medium' | 'high' | 'critical';
|
|
394
718
|
/** Human-readable summary of the impact analysis outcome. */
|
|
395
719
|
summary: string;
|
|
396
720
|
/** Nodes affected at each traversal depth. */
|
package/src/index.ts
CHANGED
|
@@ -212,6 +212,9 @@ export type {
|
|
|
212
212
|
CodeSymbol,
|
|
213
213
|
CodeSymbolKind,
|
|
214
214
|
ParseResult,
|
|
215
|
+
ParserExecutionLimits,
|
|
216
|
+
ParserExecutionPort,
|
|
217
|
+
ParserProcessHandle,
|
|
215
218
|
} from './code-symbol.js';
|
|
216
219
|
// === Conduit Protocol (agent-to-agent communication) ===
|
|
217
220
|
export type {
|
|
@@ -343,6 +346,7 @@ export type {
|
|
|
343
346
|
TaskAuditLogQuery,
|
|
344
347
|
TaskAuditLogRow,
|
|
345
348
|
TaskFieldUpdates,
|
|
349
|
+
TaskPopulation,
|
|
346
350
|
TaskQueryFilters,
|
|
347
351
|
TransactionAccessor,
|
|
348
352
|
} from './data-accessor.js';
|
|
@@ -689,13 +693,19 @@ export type {
|
|
|
689
693
|
ConfidenceProvenance,
|
|
690
694
|
ExtractedProvenance,
|
|
691
695
|
GraphEdgeConfidenceLabel,
|
|
696
|
+
GraphIndexAssessment,
|
|
697
|
+
GraphIndexFileReport,
|
|
698
|
+
GraphIndexReferenceReport,
|
|
692
699
|
GraphNode,
|
|
693
700
|
GraphNodeKind,
|
|
701
|
+
GraphPublicationRows,
|
|
694
702
|
GraphRelation,
|
|
695
703
|
GraphRelationType,
|
|
696
704
|
ImpactResult,
|
|
697
705
|
InferredProvenance,
|
|
698
706
|
KnowledgeGraph,
|
|
707
|
+
NexusNodeInsertRow,
|
|
708
|
+
NexusRelationInsertRow,
|
|
699
709
|
ProcessNode,
|
|
700
710
|
SymbolIndex,
|
|
701
711
|
} from './graph.js';
|
|
@@ -723,6 +733,34 @@ export {
|
|
|
723
733
|
} from './invariants/index.js';
|
|
724
734
|
// === Background Job Status (T9955 — promoted from core/store/tasks-schema.ts) ===
|
|
725
735
|
export type { BackgroundJobStatus } from './jobs.js';
|
|
736
|
+
// === Living Brain SDK Types (T1068 — 5-substrate traversal primitives) ===
|
|
737
|
+
export type {
|
|
738
|
+
DecisionCodeEvidenceLink,
|
|
739
|
+
DecisionCodeEvidenceOptions,
|
|
740
|
+
DecisionCodeEvidenceResult,
|
|
741
|
+
KnowledgeAuthority,
|
|
742
|
+
KnowledgeAuthorityStatus,
|
|
743
|
+
KnowledgeBackfillOptions,
|
|
744
|
+
KnowledgeCoverage,
|
|
745
|
+
KnowledgeCoverageStatus,
|
|
746
|
+
KnowledgeDiagnostic,
|
|
747
|
+
KnowledgeDiagnosticStatus,
|
|
748
|
+
KnowledgeDoctorOptions,
|
|
749
|
+
KnowledgeDoctorResult,
|
|
750
|
+
KnowledgeEvidenceRef,
|
|
751
|
+
KnowledgeFileEvidence,
|
|
752
|
+
KnowledgeHealth,
|
|
753
|
+
KnowledgeRepairAction,
|
|
754
|
+
KnowledgeRepairClass,
|
|
755
|
+
KnowledgeRepairFinding,
|
|
756
|
+
KnowledgeRepairProposal,
|
|
757
|
+
KnowledgeRepairReceipt,
|
|
758
|
+
KnowledgeRepairRecovery,
|
|
759
|
+
KnowledgeRepairState,
|
|
760
|
+
KnowledgeReplacement,
|
|
761
|
+
KnowledgeSymbolCandidate,
|
|
762
|
+
TaskKnowledgeEvidence,
|
|
763
|
+
} from './knowledge-health.js';
|
|
726
764
|
export type {
|
|
727
765
|
CleoResponse,
|
|
728
766
|
ConformanceReport,
|
|
@@ -1047,7 +1085,6 @@ export type {
|
|
|
1047
1085
|
HttpContract,
|
|
1048
1086
|
TopicContract,
|
|
1049
1087
|
} from './nexus-contract-ops.js';
|
|
1050
|
-
// === Living Brain SDK Types (T1068 — 5-substrate traversal primitives) ===
|
|
1051
1088
|
// === Extended Code Reasoning Types (T1069 — reasonWhySymbol + reasonImpactOfChange) ===
|
|
1052
1089
|
export type {
|
|
1053
1090
|
BlastRadiusSummary,
|
|
@@ -2289,8 +2326,10 @@ export type {
|
|
|
2289
2326
|
AcceptanceItem,
|
|
2290
2327
|
CancelledTask,
|
|
2291
2328
|
CompletedTask,
|
|
2329
|
+
CriterionEvidenceLink,
|
|
2292
2330
|
EpicLifecycle,
|
|
2293
2331
|
EvidenceAtom,
|
|
2332
|
+
EvidenceValidationContext,
|
|
2294
2333
|
FileMeta,
|
|
2295
2334
|
GateEvidence,
|
|
2296
2335
|
Phase,
|
|
@@ -2302,6 +2341,7 @@ export type {
|
|
|
2302
2341
|
SessionNote,
|
|
2303
2342
|
// T9071 — system-wide severity attestation primitive
|
|
2304
2343
|
SeverityAttestation,
|
|
2344
|
+
SignedSeverityAttestation,
|
|
2305
2345
|
Task,
|
|
2306
2346
|
TaskCreate,
|
|
2307
2347
|
// T944 new axes (T9072: renamed TaskRole → TaskKind)
|
|
@@ -2343,6 +2383,8 @@ export {
|
|
|
2343
2383
|
// === TaskRecord Types (string-widened for dispatch/LAFS) ===
|
|
2344
2384
|
export type {
|
|
2345
2385
|
MinimalTaskRecord,
|
|
2386
|
+
RecordProjectionDisclosure,
|
|
2387
|
+
TaskMatch,
|
|
2346
2388
|
TaskRecord,
|
|
2347
2389
|
TaskRecordRelation,
|
|
2348
2390
|
TaskRecordRelationCounts,
|
|
@@ -79,7 +79,8 @@ const VALIDATE_SPAWN_MODULE = 'packages/core/src/orchestration/validate-spawn.ts
|
|
|
79
79
|
/**
|
|
80
80
|
* Skill-validator test that exercises ORC-004 / ORC-005 manifest checks.
|
|
81
81
|
*/
|
|
82
|
-
const SKILL_VALIDATOR_TESTS =
|
|
82
|
+
const SKILL_VALIDATOR_TESTS =
|
|
83
|
+
'packages/core/src/skills/orchestrator/__tests__/validator.orchestrator.test.ts';
|
|
83
84
|
|
|
84
85
|
/**
|
|
85
86
|
* ADR-070 ORC-### invariants in declaration order.
|
|
@@ -138,9 +138,9 @@ export const ADR_073_INVARIANTS: readonly RegisteredInvariant[] = Object.freeze(
|
|
|
138
138
|
{
|
|
139
139
|
adr: 'ADR-073',
|
|
140
140
|
code: 'I7',
|
|
141
|
-
name: '
|
|
141
|
+
name: 'No nested sagas',
|
|
142
142
|
description:
|
|
143
|
-
'The parent ladder Subtask → Task → Epic is fixed at depth 3
|
|
143
|
+
'A saga-member candidate MUST NOT itself be saga-shaped. Enforced at runtime by assertSagaInvariantI7, which checks exactly this and nothing else. The depth clause this invariant used to carry — "the parent ladder Subtask → Task → Epic is fixed at depth 3; sagas do NOT consume depth, they attach via groups relations, not parent edges" — is SUPERSEDED BY ADR-088: member epics now attach via tasks.parent_id containment and task_relations.groups is non-containment provenance only, so a saga DOES consume a level. The canonical spine is saga(0) → epic(1) → task(2) → subtask(3) at hierarchy.maxDepth=3, inclusive; the depth rule lives in exceedsMaxDepth (core tasks/hierarchy.ts), never here. The stale clause outlived its premise by long enough for the write-path guards calibrated on it to make the subtask tier unreachable.',
|
|
144
144
|
severity: 'error',
|
|
145
145
|
runtimeGate: {
|
|
146
146
|
module: SAGA_ENFORCEMENT_MODULE,
|