ucn 4.2.3 → 5.0.2
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/.claude/skills/ucn/SKILL.md +89 -77
- package/.claude/skills/ucn/references/commands.md +62 -68
- package/.claude/skills/ucn/references/trust-contract.md +31 -6
- package/README.md +438 -305
- package/assets/demo.svg +31 -0
- package/cli/index.js +430 -1385
- package/core/account.js +144 -34
- package/core/analysis.js +182 -72
- package/core/ast-analysis.js +279 -0
- package/core/bridge.js +205 -24
- package/core/brief.js +27 -58
- package/core/build-worker.js +21 -140
- package/core/cache.js +513 -11
- package/core/callers.js +4920 -456
- package/core/check.js +13 -4
- package/core/command-contracts.js +402 -0
- package/core/compilation-database.js +276 -0
- package/core/confidence.js +4 -1
- package/core/deadcode.js +397 -19
- package/core/discovery.js +359 -46
- package/core/entrypoints.js +195 -41
- package/core/execute.js +887 -81
- package/core/graph-build.js +162 -7
- package/core/graph.js +53 -77
- package/core/imports.js +65 -6
- package/core/index-ir.js +138 -0
- package/core/ir.js +195 -0
- package/core/output/analysis.js +212 -22
- package/core/output/brief.js +23 -0
- package/core/output/check.js +4 -0
- package/core/output/doctor.js +37 -6
- package/core/output/endpoints.js +5 -2
- package/core/output/extraction.js +24 -12
- package/core/output/find.js +141 -36
- package/core/output/graph.js +11 -5
- package/core/output/public.js +462 -0
- package/core/output/refactoring.js +42 -10
- package/core/output/reporting.js +97 -20
- package/core/output/search.js +24 -16
- package/core/output/shared.js +22 -1
- package/core/output/tracing.js +30 -15
- package/core/output-budget.js +295 -0
- package/core/output.js +1 -0
- package/core/parallel-build.js +44 -11
- package/core/parser.js +3 -3
- package/core/project.js +384 -187
- package/core/public-command.js +47 -0
- package/core/registry.js +247 -117
- package/core/reporting.js +312 -290
- package/core/search.js +317 -185
- package/core/semantic-provider.js +110 -0
- package/core/stacktrace.js +25 -0
- package/core/tracing.js +101 -51
- package/core/trust-matrix.js +19 -40
- package/core/verify.js +534 -37
- package/languages/adapter.js +218 -0
- package/languages/c-family.js +2791 -0
- package/languages/c.js +3 -0
- package/languages/cpp.js +3 -0
- package/languages/csharp.js +1402 -0
- package/languages/go.js +60 -21
- package/languages/html.js +2 -2
- package/languages/index.js +85 -7
- package/languages/java.js +396 -13
- package/languages/javascript.js +199 -19
- package/languages/python.js +964 -22
- package/languages/rust.js +1317 -152
- package/languages/utils.js +40 -3
- package/mcp/server.js +254 -636
- package/package.json +39 -22
- package/eslint.config.js +0 -43
- package/jsconfig.json +0 -10
package/core/trust-matrix.js
CHANGED
|
@@ -41,6 +41,11 @@ const PROOF_CATALOG = Object.freeze({
|
|
|
41
41
|
artifact: 'test/conservation.test.js',
|
|
42
42
|
claim: 'Observed text occurrences partition without unexplained loss.',
|
|
43
43
|
},
|
|
44
|
+
'cross-command-consistency': {
|
|
45
|
+
kind: 'relational-invariant',
|
|
46
|
+
artifact: 'eval/run-consistency-eval.js',
|
|
47
|
+
claim: 'Overlapping stable-handle commands agree exactly on target identity, projections, caller tiers, evidence reasons, totals, and accounting.',
|
|
48
|
+
},
|
|
44
49
|
'cross-language-fixtures': {
|
|
45
50
|
kind: 'independent-fixture',
|
|
46
51
|
artifact: 'test/cross-language.test.js',
|
|
@@ -79,7 +84,7 @@ const PROOF_CATALOG = Object.freeze({
|
|
|
79
84
|
'protocol-fixtures': {
|
|
80
85
|
kind: 'protocol-invariant',
|
|
81
86
|
artifact: 'test/regression-mcp.test.js',
|
|
82
|
-
claim: '
|
|
87
|
+
claim: 'The one-tool MCP schema, error envelopes, cache freshness, and truncation contract are checked end-to-end.',
|
|
83
88
|
},
|
|
84
89
|
'performance-budget': {
|
|
85
90
|
kind: 'performance-gate',
|
|
@@ -93,50 +98,24 @@ function row(claim, proofs, performanceClass, decisionSafety, oracleReason = nul
|
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
const COMMAND_TRUST_MATRIX = Object.freeze({
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
impact: row('tiered-semantic', ['oracle-callers', 'conservation', 'surface-parity'], 'semantic-query', 'review-required'),
|
|
99
|
-
blast: row('tiered-derived', ['oracle-callers', 'conservation', 'command-fixtures', 'surface-parity'], 'graph-query', 'review-required'),
|
|
100
|
-
smart: row('tiered-derived', ['oracle-callees', 'oracle-symbols', 'command-fixtures', 'surface-parity'], 'semantic-query', 'review-required'),
|
|
101
|
-
trace: row('tiered-derived', ['oracle-callees', 'conservation', 'command-fixtures', 'surface-parity'], 'graph-query', 'review-required'),
|
|
102
|
-
reverseTrace: row('tiered-derived', ['oracle-callers', 'conservation', 'command-fixtures', 'surface-parity'], 'graph-query', 'review-required'),
|
|
103
|
-
example: row('confirmed-or-abstain-advisory', ['oracle-references', 'command-fixtures', 'surface-parity'], 'semantic-query', 'advisory-only'),
|
|
104
|
-
related: row('advisory-ranking', ['oracle-callers', 'oracle-callees', 'command-fixtures', 'surface-parity'], 'semantic-query', 'advisory-only'),
|
|
105
|
-
brief: row('ast-fact-summary', ['oracle-symbols', 'command-fixtures', 'surface-parity'], 'source-query', 'navigation'),
|
|
106
|
-
|
|
107
|
-
find: row('exact-indexed-definition', ['oracle-symbols', 'cross-language-fixtures', 'surface-parity'], 'symbol-query', 'navigation'),
|
|
101
|
+
show: row('tiered-symbol-projection', ['oracle-callers', 'oracle-callees', 'oracle-symbols', 'oracle-references', 'conservation', 'cross-command-consistency', 'command-fixtures', 'surface-parity'], 'semantic-query', 'review-required'),
|
|
102
|
+
find: row('exact-indexed-definition', ['oracle-symbols', 'cross-command-consistency', 'cross-language-fixtures', 'surface-parity'], 'symbol-query', 'navigation'),
|
|
108
103
|
usages: row('literal-code-reference-inventory', ['oracle-references', 'cross-language-fixtures', 'surface-parity'], 'project-scan', 'review-required'),
|
|
109
|
-
toc: row('indexed-symbol-accounting', ['cross-language-fixtures', 'command-fixtures', 'surface-parity'], 'project-scan', 'navigation', 'No compiler exposes a portable table-of-contents contract; symbol totals and filters use fixture/accounting invariants.'),
|
|
110
104
|
search: row('literal-or-structural-match', ['cross-language-fixtures', 'command-fixtures', 'systematic-options', 'surface-parity'], 'project-scan', 'navigation', 'Literal results are text-ground exact; structural filters are AST fixture-checked rather than semantic identity claims.'),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
fn: row('exact-source-extraction', ['oracle-symbols', 'cross-language-fixtures', 'surface-parity'], 'source-query', 'navigation'),
|
|
118
|
-
class: row('exact-source-extraction', ['oracle-symbols', 'cross-language-fixtures', 'surface-parity'], 'source-query', 'navigation'),
|
|
119
|
-
lines: row('exact-file-slice', ['command-fixtures', 'systematic-options', 'surface-parity'], 'source-query', 'navigation', 'The file bytes and validated line bounds are the direct oracle.'),
|
|
120
|
-
expand: row('stateful-protocol', ['protocol-fixtures', 'surface-parity'], 'source-query', 'navigation', 'Expansion is a cache/protocol contract, not a semantic-analysis claim.'),
|
|
121
|
-
|
|
122
|
-
imports: row('static-import-inventory', ['graph-invariants', 'cross-language-fixtures', 'surface-parity'], 'graph-query', 'navigation', 'File import syntax/resolution is checked with language fixtures and graph duality; dynamic imports remain explicit blind spots.'),
|
|
123
|
-
exporters: row('reverse-static-import-inventory', ['graph-invariants', 'cross-language-fixtures', 'surface-parity'], 'graph-query', 'navigation', 'Reverse edges are proven by import/export graph duality.'),
|
|
124
|
-
fileExports: row('static-export-inventory', ['graph-invariants', 'cross-language-fixtures', 'surface-parity'], 'graph-query', 'navigation', 'Static visibility/export shapes use language fixtures; runtime mutation remains outside the claim.'),
|
|
125
|
-
graph: row('static-dependency-traversal', ['graph-invariants', 'cross-language-fixtures', 'surface-parity'], 'graph-query', 'navigation', 'Traversal is an algebraic derivative of the static import graph.'),
|
|
126
|
-
circularDeps: row('static-cycle-detection', ['graph-invariants', 'command-fixtures', 'surface-parity'], 'graph-query', 'navigation', 'Cycle output is checked against known graph fixtures and traversal invariants.'),
|
|
127
|
-
|
|
128
|
-
verify: row('tiered-signature-check', ['oracle-callers', 'cross-language-fixtures', 'command-fixtures', 'surface-parity'], 'semantic-query', 'review-required'),
|
|
105
|
+
source: row('exact-source-or-line-extraction', ['oracle-symbols', 'cross-command-consistency', 'cross-language-fixtures', 'command-fixtures', 'systematic-options', 'surface-parity'], 'source-query', 'navigation', 'Symbol source is compiler/LSP-gated; line slices are checked directly against validated file bytes.'),
|
|
106
|
+
trace: row('tiered-bidirectional-call-traversal', ['oracle-callers', 'oracle-callees', 'conservation', 'cross-command-consistency', 'command-fixtures', 'surface-parity'], 'graph-query', 'review-required'),
|
|
107
|
+
impact: row('tiered-symbol-or-git-impact', ['oracle-callers', 'conservation', 'cross-command-consistency', 'git-fixtures', 'command-fixtures', 'surface-parity'], 'semantic-query', 'review-required'),
|
|
108
|
+
tests: row('tiered-direct-or-transitive-test-evidence', ['oracle-callers', 'oracle-references', 'conservation', 'cross-command-consistency', 'cross-language-fixtures', 'command-fixtures', 'surface-parity'], 'graph-query', 'review-required'),
|
|
109
|
+
check: row('tiered-signature-or-precommit-diagnostic', ['oracle-callers', 'oracle-references', 'cross-command-consistency', 'git-fixtures', 'command-fixtures', 'surface-parity'], 'semantic-query', 'review-required'),
|
|
129
110
|
plan: row('refactor-preview', ['oracle-callers', 'cross-language-fixtures', 'command-fixtures', 'surface-parity'], 'semantic-query', 'review-required'),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
typedef: row('exact-indexed-type', ['oracle-symbols', 'cross-language-fixtures', 'surface-parity'], 'symbol-query', 'navigation'),
|
|
134
|
-
stacktrace: row('advisory-frame-resolution', ['command-fixtures', 'surface-parity'], 'source-query', 'advisory-only', 'Stack formats and source-map/runtime availability are environment-specific; unresolved frames remain visible.'),
|
|
111
|
+
repo: row('diagnostic-repository-composition', ['cross-language-fixtures', 'command-fixtures', 'systematic-options', 'surface-parity'], 'project-scan', 'navigation', 'Repository orientation composes index accounting, framework hints, and explicit readiness diagnostics; it is not an accuracy estimate.'),
|
|
112
|
+
deps: row('static-dependency-analysis', ['graph-invariants', 'cross-language-fixtures', 'command-fixtures', 'surface-parity'], 'graph-query', 'navigation', 'Import, importer, traversal, and cycle views are algebraic derivatives of the static import graph; dynamic imports remain explicit blind spots.'),
|
|
135
113
|
api: row('static-public-surface', ['graph-invariants', 'cross-language-fixtures', 'command-fixtures', 'surface-parity'], 'project-scan', 'review-required', 'Static exports are the claim; reflection and external consumers are explicitly outside the universe.'),
|
|
136
|
-
|
|
137
|
-
|
|
114
|
+
entrypoints: row('framework-advisory', ['framework-fixtures', 'cross-language-fixtures', 'surface-parity'], 'project-scan', 'advisory-only', 'Framework registration/reflection has no universal compiler oracle; positive and confusable framework fixtures define the static claim.'),
|
|
115
|
+
endpoints: row('framework-advisory', ['framework-fixtures', 'cross-language-fixtures', 'surface-parity'], 'project-scan', 'advisory-only', 'Route/client matching is framework-specific and explicitly advisory.'),
|
|
116
|
+
deadcode: row('candidate-not-safe-delete', ['oracle-deadcode', 'cross-language-fixtures', 'command-fixtures', 'surface-parity'], 'project-scan', 'advisory-only'),
|
|
138
117
|
auditAsync: row('async-advisory', ['cross-language-fixtures', 'command-fixtures', 'surface-parity'], 'project-scan', 'advisory-only', 'Missing-await semantics depend on framework/type flow; findings are advisory and fixture-tested.'),
|
|
139
|
-
|
|
118
|
+
stacktrace: row('advisory-frame-resolution', ['command-fixtures', 'surface-parity'], 'source-query', 'advisory-only', 'Stack formats and source-map/runtime availability are environment-specific; unresolved frames remain visible.'),
|
|
140
119
|
});
|
|
141
120
|
|
|
142
121
|
function summarizeCommandTrust() {
|