@event4u/agent-config 17.2.1 → 17.4.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/.augment-plugin/marketplace.json +3 -3
- package/.augment-plugin/plugin.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/skills/install-agent-config/SKILL.md +9 -9
- package/CHANGELOG.md +167 -193
- package/CREDITS.md +2 -2
- package/README.md +1 -1
- package/dist/agent-src/skills/code-intelligence/SKILL.md +16 -12
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/scripts/check_memory.ts +1 -1
- package/dist/cli/commands/recordTriggerEval.js +1 -1
- package/dist/cli/registry.js +2 -2
- package/dist/cli-delegate/{chunk-KR5ZIFPO.js → chunk-5AYJGUA3.js} +1 -3
- package/dist/cli-delegate/chunk-DIFZBP4G.js +1336 -0
- package/dist/cli-delegate/chunk-E7ACTJTJ.js +6792 -0
- package/dist/cli-delegate/{chunk-VYZGJLCA.js → chunk-RKNT4LIK.js} +22 -1286
- package/dist/cli-delegate/{chunk-BZJ4Y3CI.js → chunk-WY5ZZPGL.js} +2 -2
- package/dist/cli-delegate/{chunk-CMZEKSNN.js → chunk-X6LZ7W5A.js} +73 -10
- package/dist/cli-delegate/cmd_conformance.js +190 -192
- package/dist/cli-delegate/cmd_doctor.js +5 -5
- package/dist/cli-delegate/cmd_doctor_neighbours.js +3 -3
- package/dist/cli-delegate/cmd_explain.js +1 -1
- package/dist/cli-delegate/cmd_export.js +2 -2
- package/dist/cli-delegate/cmd_handoff.js +2 -2
- package/dist/cli-delegate/cmd_memory_get.js +1 -1
- package/dist/cli-delegate/cmd_prune.js +2 -2
- package/dist/cli-delegate/cmd_route_audit.js +1 -1
- package/dist/cli-delegate/cmd_session_recycle.js +2 -2
- package/dist/cli-delegate/cmd_settings_migrate.js +2 -2
- package/dist/cli-delegate/cmd_settings_set.js +8 -4
- package/dist/cli-delegate/cmd_sync.js +2 -2
- package/dist/cli-delegate/cmd_uninstall.js +2 -2
- package/dist/cli-delegate/cmd_update.js +24 -13
- package/dist/cli-delegate/cmd_upgrade.js +2 -2
- package/dist/cli-delegate/cmd_validate.js +2 -2
- package/dist/cli-delegate/dist-25AZAHOP.js +3240 -0
- package/dist/cli-delegate/dist-P7MFPMF3.js +411 -0
- package/dist/cli-delegate/dist-XAS5ZLQB.js +6 -0
- package/dist/cli-delegate/{upgrade_unattended-VVL6JLSX.js → upgrade_unattended-QCWOKTUN.js} +178 -163
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +3 -3
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +1 -1
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +2 -2
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +2 -2
- package/dist/hooks/code_graph_refresh.chunk.cjs +443 -0
- package/dist/hooks/code_graph_refresh.chunk.cjs.sha256 +1 -0
- package/dist/hooks/dispatch.js +1001 -938
- package/dist/hooks/dispatch.sha256 +1 -1
- package/dist/hooks/egress_engine.chunk.cjs +57 -7
- package/dist/hooks/egress_engine.chunk.cjs.sha256 +1 -1
- package/dist/hooks/update_notice.chunk.cjs +914 -0
- package/dist/hooks/update_notice.chunk.cjs.sha256 +1 -0
- package/dist/install/install.mjs +6974 -6037
- package/dist/mcp/mcp-cloudflare-catalogue.json +1 -0
- package/dist/mcp/registry-manifest.json +3 -2
- package/dist/mcp/server.json +13 -4
- package/dist/mcp/server.mjs +71202 -63282
- package/dist/scripts/_lib/egress_rules.js +8 -2
- package/dist/scripts/condense.js +18 -15
- package/dist/server/routes/discovery.js +1 -1
- package/dist/server/routes/install.js +1 -1
- package/dist/server/routes/ping.js +1 -1
- package/dist/server/routes/schema.js +4 -4
- package/dist/server/routes/settings.js +2 -6
- package/dist/server/routes/wizard.js +6 -6
- package/dist/server/schemas/settings.js +42 -42
- package/dist/shared/settingsSurface.js +1 -1
- package/dist/shared/userMd/schema.js +1 -1
- package/dist/shared/zodJsonSchema.js +47 -0
- package/dist/ui/assets/index-B0bcIgi0.js +77 -0
- package/dist/ui/index.html +1 -1
- package/package.json +6 -3
- package/src/agent-src/templates/scripts/check_memory.ts +1 -1
- package/src/config/ci-local-parity.yml +11 -0
- package/src/config/continuity-surface.json +9 -2
- package/src/config/evaluator-budgets.json +9 -8
- package/src/config/gate-violation-baselines.json +3 -3
- package/src/config/gitignore-block.txt +6 -5
- package/src/config/hook-bundle-budget.json +46 -6
- package/src/config/pack-size-budget.json +12 -1
- package/src/config/packed-binary-manifest.json +18 -0
- package/src/config/sigstore/npm_keys.json +50 -0
- package/src/config/sigstore/trust-material.json +9 -0
- package/src/config/sigstore/trusted_root.json +126 -0
- package/src/config/skill-body-budget.json +7 -1
- package/src/scripts/_cli/cmd_settings_set.ts +3 -2
- package/src/scripts/_cli/cmd_update.ts +48 -20
- package/src/scripts/_cli/cmd_upgrade.ts +7 -1
- package/src/scripts/_cli/upgrade_unattended.ts +90 -76
- package/src/scripts/_dispatch.bash +4 -3
- package/src/scripts/_lib/confusables.ts +0 -19
- package/src/scripts/_lib/egress_normalize.ts +53 -23
- package/src/scripts/_lib/egress_rules.ts +8 -2
- package/src/scripts/_lib/egress_text.ts +5 -3
- package/src/scripts/_lib/egress_token.ts +7 -5
- package/src/scripts/_lib/gate_collector_experimental.ts +633 -0
- package/src/scripts/_lib/git_common_dir.ts +10 -0
- package/src/scripts/_lib/graph_feeder_record.ts +3 -2
- package/src/scripts/_lib/install_reach_checks.ts +32 -2
- package/src/scripts/_lib/lineage_backfill.ts +136 -0
- package/src/scripts/_lib/lineage_ledger.ts +211 -0
- package/src/scripts/_lib/lineage_map.ts +55 -0
- package/src/scripts/_lib/lineage_query.ts +140 -0
- package/src/scripts/_lib/lineage_seed.ts +116 -0
- package/src/scripts/_lib/lineage_watch.ts +249 -0
- package/src/scripts/_lib/link_crypto.ts +8 -4
- package/src/scripts/_lib/listing_manifests.ts +85 -0
- package/src/scripts/_lib/neighbour_census.ts +1 -0
- package/src/scripts/_lib/production_reach.ts +3 -3
- package/src/scripts/_lib/project_registry.ts +227 -0
- package/src/scripts/_lib/provenance_verify.ts +14 -242
- package/src/scripts/_lib/release_settings_surface.ts +2 -6
- package/src/scripts/_lib/sigstore_provenance.ts +177 -0
- package/src/scripts/_lib/source_id.ts +48 -0
- package/src/scripts/_lib/source_shape.ts +4 -0
- package/src/scripts/_lib/unattended_gates.ts +6 -1
- package/src/scripts/adoption_status.ts +231 -27
- package/src/scripts/advisories.ts +26 -10
- package/src/scripts/ai_council/council_egress.ts +5 -6
- package/src/scripts/bench_graph_feeder_latency.ts +10 -3
- package/src/scripts/build_mcp_registry_manifest.ts +23 -12
- package/src/scripts/check_dependency_floors.ts +14 -0
- package/src/scripts/check_egress_mutations.ts +1 -0
- package/src/scripts/check_release_manifest_content.ts +17 -2
- package/src/scripts/check_release_pr_shape.ts +5 -0
- package/src/scripts/code_graph/build.ts +145 -45
- package/src/scripts/code_graph/cli.ts +382 -35
- package/src/scripts/code_graph/conventions_default.ts +247 -0
- package/src/scripts/code_graph/detect.ts +5 -5
- package/src/scripts/code_graph/estate_cli.ts +135 -0
- package/src/scripts/code_graph/estate_index.ts +394 -0
- package/src/scripts/code_graph/estate_manifests.ts +223 -0
- package/src/scripts/code_graph/estate_map.ts +141 -0
- package/src/scripts/code_graph/extract.ts +8 -2
- package/src/scripts/code_graph/extract_more.ts +241 -2
- package/src/scripts/code_graph/graph_budget.ts +158 -0
- package/src/scripts/code_graph/graph_home.ts +80 -0
- package/src/scripts/code_graph/lineage_cli.ts +315 -0
- package/src/scripts/code_graph/loader.ts +10 -2
- package/src/scripts/code_graph/map.ts +195 -53
- package/src/scripts/code_graph/map_model.ts +113 -20
- package/src/scripts/code_graph/map_verify.ts +80 -5
- package/src/scripts/code_graph/map_viewer/viewer.css +18 -0
- package/src/scripts/code_graph/map_viewer/viewer.js +146 -15
- package/src/scripts/code_graph/passes.ts +173 -0
- package/src/scripts/code_graph/project_ref.ts +25 -0
- package/src/scripts/code_graph/projects_cli.ts +254 -0
- package/src/scripts/code_graph/providers/angular.ts +55 -0
- package/src/scripts/code_graph/providers/aspnetcore.ts +182 -0
- package/src/scripts/code_graph/providers/catalog.ts +299 -0
- package/src/scripts/code_graph/providers/django.ts +206 -0
- package/src/scripts/code_graph/providers/express.ts +25 -0
- package/src/scripts/code_graph/providers/fastapi.ts +49 -0
- package/src/scripts/code_graph/providers/flask.ts +99 -0
- package/src/scripts/code_graph/providers/go_http.ts +121 -0
- package/src/scripts/code_graph/providers/index.ts +103 -0
- package/src/scripts/code_graph/{laravel_overlay.ts → providers/laravel.ts} +113 -7
- package/src/scripts/code_graph/providers/nestjs.ts +34 -0
- package/src/scripts/code_graph/providers/nextjs.ts +91 -0
- package/src/scripts/code_graph/providers/nuxt.ts +55 -0
- package/src/scripts/code_graph/providers/rails.ts +204 -0
- package/src/scripts/code_graph/providers/react-router.ts +58 -0
- package/src/scripts/code_graph/providers/shared/detect.ts +78 -0
- package/src/scripts/code_graph/providers/shared/extractors.ts +249 -0
- package/src/scripts/code_graph/providers/shared/js.ts +252 -0
- package/src/scripts/code_graph/providers/shared/kit.ts +210 -0
- package/src/scripts/code_graph/providers/shared/php.ts +64 -0
- package/src/scripts/code_graph/providers/shared/python.ts +223 -0
- package/src/scripts/code_graph/providers/spring.ts +175 -0
- package/src/scripts/code_graph/providers/sqlalchemy.ts +62 -0
- package/src/scripts/code_graph/providers/sveltekit.ts +59 -0
- package/src/scripts/code_graph/providers/symfony.ts +142 -0
- package/src/scripts/code_graph/providers/typeorm.ts +58 -0
- package/src/scripts/code_graph/providers/types.ts +56 -0
- package/src/scripts/code_graph/providers/vue-router.ts +21 -0
- package/src/scripts/code_graph/providers/wordpress.ts +128 -0
- package/src/scripts/code_graph/query.ts +9 -9
- package/src/scripts/code_graph/refresh_cli.ts +81 -0
- package/src/scripts/code_graph/refresh_lock.ts +197 -0
- package/src/scripts/code_graph/repo_identity.ts +169 -0
- package/src/scripts/code_graph/resolution_tiers.ts +19 -7
- package/src/scripts/code_graph/scip_reader.ts +2 -2
- package/src/scripts/code_graph/sqlite_store.ts +31 -28
- package/src/scripts/code_graph/types.ts +79 -41
- package/src/scripts/code_graph/validate.ts +6 -8
- package/src/scripts/condense.ts +15 -15
- package/src/scripts/generate_settings_reference.ts +2 -6
- package/src/scripts/hook_chunks.mjs +11 -0
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +43 -23
- package/src/scripts/hooks/code_graph_refresh_hook.ts +163 -0
- package/src/scripts/hooks/dispatch_hook.ts +6 -7
- package/src/scripts/hooks/host_semantics.ts +72 -0
- package/src/scripts/hooks/lazy_concern.ts +8 -0
- package/src/scripts/hooks/user_notice.ts +105 -0
- package/src/scripts/install-hooks.sh +54 -33
- package/src/scripts/install.ts +2 -6
- package/src/scripts/lint_harvest_provenance.ts +137 -11
- package/src/scripts/lint_hook_manifest.ts +2 -0
- package/src/scripts/lint_marketplace.ts +33 -0
- package/src/scripts/lint_mcp_registry_manifest.ts +36 -0
- package/src/scripts/mcp_server/consumer_tool_catalog.json +70 -15
- package/src/scripts/mcp_server/graph_tools.ts +165 -41
- package/src/scripts/network_sources.ts +24 -6
- package/src/scripts/release.ts +2 -5
- package/src/scripts/release_drill.ts +4 -1
- package/src/scripts/release_env.ts +17 -0
- package/src/scripts/release_mix_taxonomy.json +3 -0
- package/src/scripts/schemas/provenance-mechanism.schema.json +46 -0
- package/src/scripts/update_notice_hook.ts +75 -7
- package/src/server/schemas/settings.ts +42 -42
- package/src/shared/settingsSurface.ts +1 -1
- package/src/shared/userMd/schema.ts +1 -1
- package/src/shared/zodJsonSchema.ts +41 -0
- package/src/vendor/grammars/README.md +8 -6
- package/src/vendor/grammars/tree-sitter-c_sharp.wasm +0 -0
- package/src/vendor/grammars/tree-sitter-ruby.wasm +0 -0
- package/dist/cli-delegate/chunk-XIAPY44N.js +0 -4587
- package/dist/ui/assets/index-w70Ado09.js +0 -23
- /package/dist/cli-delegate/{chunk-FKYZOWVD.js → chunk-QBAFP67O.js} +0 -0
- /package/dist/cli-delegate/{chunk-BMGUGSY6.js → chunk-TQG6UMPC.js} +0 -0
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
proseEqual,
|
|
62
62
|
resolveSessionRole,
|
|
63
63
|
splitFrontmatter
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-X6LZ7W5A.js";
|
|
65
65
|
import {
|
|
66
66
|
_is_global_only_consumer
|
|
67
67
|
} from "./chunk-2Y5AMLMY.js";
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
EXIT_BLOCK,
|
|
87
87
|
EXIT_WARN,
|
|
88
88
|
projectStoreSlug
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-QBAFP67O.js";
|
|
90
90
|
import "./chunk-IAYTIIQW.js";
|
|
91
91
|
import "./chunk-PV7S5DPJ.js";
|
|
92
92
|
import "./chunk-LQOCRFWT.js";
|
|
@@ -103,9 +103,9 @@ import {
|
|
|
103
103
|
import {
|
|
104
104
|
load_agent_settings
|
|
105
105
|
} from "./chunk-XLY5G3CM.js";
|
|
106
|
-
import "./chunk-
|
|
106
|
+
import "./chunk-WY5ZZPGL.js";
|
|
107
107
|
import "./chunk-FIEEOH5C.js";
|
|
108
|
-
import "./chunk-
|
|
108
|
+
import "./chunk-5AYJGUA3.js";
|
|
109
109
|
import {
|
|
110
110
|
artefact_roots
|
|
111
111
|
} from "./chunk-YCU3TIXH.js";
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
resolveRouteTransport
|
|
121
121
|
} from "./chunk-M6CRG5O6.js";
|
|
122
122
|
import "./chunk-MWRD5YOH.js";
|
|
123
|
-
import "./chunk-
|
|
123
|
+
import "./chunk-TQG6UMPC.js";
|
|
124
124
|
import {
|
|
125
125
|
readHookStdin
|
|
126
126
|
} from "./chunk-RAXQOETZ.js";
|
|
@@ -147,7 +147,7 @@ import {
|
|
|
147
147
|
var YAML = __toESM(require_dist(), 1);
|
|
148
148
|
import * as fs22 from "node:fs";
|
|
149
149
|
import * as os7 from "node:os";
|
|
150
|
-
import * as
|
|
150
|
+
import * as path20 from "node:path";
|
|
151
151
|
import process5 from "node:process";
|
|
152
152
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
153
153
|
import { fileURLToPath as fileURLToPath13, pathToFileURL as pathToFileURL13 } from "node:url";
|
|
@@ -180,7 +180,7 @@ function routeTargetPathsPosix(target) {
|
|
|
180
180
|
// src/scripts/report_conformance_funnel.ts
|
|
181
181
|
import * as fs21 from "node:fs";
|
|
182
182
|
import * as os6 from "node:os";
|
|
183
|
-
import * as
|
|
183
|
+
import * as path19 from "node:path";
|
|
184
184
|
import process4 from "node:process";
|
|
185
185
|
import { fileURLToPath as fileURLToPath12, pathToFileURL as pathToFileURL12 } from "node:url";
|
|
186
186
|
|
|
@@ -188,7 +188,7 @@ import { fileURLToPath as fileURLToPath12, pathToFileURL as pathToFileURL12 } fr
|
|
|
188
188
|
import { createHash as createHash4 } from "node:crypto";
|
|
189
189
|
import fs17 from "node:fs";
|
|
190
190
|
import os2 from "node:os";
|
|
191
|
-
import
|
|
191
|
+
import path15 from "node:path";
|
|
192
192
|
import { fileURLToPath as fileURLToPath8, pathToFileURL as pathToFileURL8 } from "node:url";
|
|
193
193
|
|
|
194
194
|
// src/scripts/_lib/transcript_entry.ts
|
|
@@ -1975,7 +1975,7 @@ var COMMAND_OBJECTS = {
|
|
|
1975
1975
|
|
|
1976
1976
|
// src/scripts/hooks/turn_end_gate_hook.ts
|
|
1977
1977
|
import * as fs12 from "node:fs";
|
|
1978
|
-
import * as
|
|
1978
|
+
import * as path11 from "node:path";
|
|
1979
1979
|
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL5 } from "node:url";
|
|
1980
1980
|
|
|
1981
1981
|
// src/scripts/check_reply_consistency.ts
|
|
@@ -2356,19 +2356,44 @@ function detectDroppedDecision(assistantTurnTexts, closingFromPayload = false) {
|
|
|
2356
2356
|
|
|
2357
2357
|
// src/scripts/_lib/graph_feeder_record.ts
|
|
2358
2358
|
import * as fs7 from "node:fs";
|
|
2359
|
-
import * as
|
|
2359
|
+
import * as path7 from "node:path";
|
|
2360
2360
|
|
|
2361
2361
|
// src/scripts/code_graph/detect.ts
|
|
2362
2362
|
import { execFileSync } from "node:child_process";
|
|
2363
2363
|
import * as fs4 from "node:fs";
|
|
2364
|
+
import * as path5 from "node:path";
|
|
2365
|
+
|
|
2366
|
+
// src/scripts/code_graph/graph_home.ts
|
|
2364
2367
|
import * as path4 from "node:path";
|
|
2368
|
+
var STATE_DIR_REL = path4.join("agents", "runtime", "state");
|
|
2369
|
+
var NATIVE_CACHE_REL = path4.join(STATE_DIR_REL, "code-graph-v1.json");
|
|
2370
|
+
var MAP_DIR_REL = path4.join("agents", "map");
|
|
2371
|
+
var LOCK_REL = path4.join(STATE_DIR_REL, "code-graph-refresh.lock");
|
|
2372
|
+
var AUTO_REFRESH_REL = path4.join(STATE_DIR_REL, "code-graph-auto-refresh.json");
|
|
2373
|
+
function projectHome(root) {
|
|
2374
|
+
return {
|
|
2375
|
+
kind: "project",
|
|
2376
|
+
root,
|
|
2377
|
+
dir: path4.join(root, "agents"),
|
|
2378
|
+
stateDir: path4.join(root, STATE_DIR_REL),
|
|
2379
|
+
cachePath: path4.join(root, NATIVE_CACHE_REL),
|
|
2380
|
+
mapDir: path4.join(root, MAP_DIR_REL),
|
|
2381
|
+
lockPath: path4.join(root, LOCK_REL),
|
|
2382
|
+
autoRefreshPath: path4.join(root, AUTO_REFRESH_REL),
|
|
2383
|
+
repoId: null,
|
|
2384
|
+
instance: null
|
|
2385
|
+
};
|
|
2386
|
+
}
|
|
2365
2387
|
|
|
2366
2388
|
// src/scripts/code_graph/types.ts
|
|
2367
|
-
var
|
|
2389
|
+
var STATED_WORDS = "same-file import-specifier path-alias psr4 route-table directive-scan schema-call orm-relation di-binding compiler-index namespace-scope test-import literal-path literal-dotted fs-route";
|
|
2390
|
+
var GUESS_WORDS = "name-lookup dynamic foreign";
|
|
2391
|
+
var STATED_RESOLVED_VIA = new Set(STATED_WORDS.split(" "));
|
|
2392
|
+
var GUESS_RESOLVED_VIA = new Set(GUESS_WORDS.split(" "));
|
|
2368
2393
|
function isStatedResolution(resolved_via) {
|
|
2369
|
-
return
|
|
2394
|
+
return STATED_RESOLVED_VIA.has(resolved_via);
|
|
2370
2395
|
}
|
|
2371
|
-
var SCHEMA_VERSION =
|
|
2396
|
+
var SCHEMA_VERSION = 6;
|
|
2372
2397
|
var EXT_LANG = {
|
|
2373
2398
|
".php": "php",
|
|
2374
2399
|
".ts": "typescript",
|
|
@@ -2382,18 +2407,18 @@ var EXT_LANG = {
|
|
|
2382
2407
|
".py": "python",
|
|
2383
2408
|
".go": "go",
|
|
2384
2409
|
".java": "java",
|
|
2410
|
+
".cs": "csharp",
|
|
2411
|
+
".rb": "ruby",
|
|
2385
2412
|
".vue": "typescript"
|
|
2386
2413
|
};
|
|
2387
2414
|
|
|
2388
2415
|
// src/scripts/code_graph/validate.ts
|
|
2389
2416
|
var words = (s) => new Set(s.split(" "));
|
|
2390
2417
|
var RELATIONS = words(
|
|
2391
|
-
"calls imports uses inherits member tests routes-to renders includes reads migrates persists relates documents"
|
|
2418
|
+
"calls imports uses inherits member tests routes-to renders includes reads migrates persists relates injects documents"
|
|
2392
2419
|
);
|
|
2393
2420
|
var CONFIDENCES = /* @__PURE__ */ new Set(["EXTRACTED", "INFERRED", "AMBIGUOUS"]);
|
|
2394
|
-
var RESOLVED_VIA =
|
|
2395
|
-
"same-file import-specifier path-alias psr4 route-table directive-scan schema-call eloquent-relation compiler-index test-import name-lookup dynamic foreign"
|
|
2396
|
-
);
|
|
2421
|
+
var RESOLVED_VIA = /* @__PURE__ */ new Set([...STATED_RESOLVED_VIA, ...GUESS_RESOLVED_VIA]);
|
|
2397
2422
|
var PROVIDERS = /* @__PURE__ */ new Set(["native", "foreign", "scip"]);
|
|
2398
2423
|
var KINDS = words("file class interface trait function method constant type enum skipped route table");
|
|
2399
2424
|
function validateGraph(g) {
|
|
@@ -2434,6 +2459,8 @@ function validateGraph(g) {
|
|
|
2434
2459
|
if (ee["provider"] === void 0) push(`edge[${i}].provider is required`);
|
|
2435
2460
|
else if (!PROVIDERS.has(ee["provider"]))
|
|
2436
2461
|
push(`edge[${i}].provider invalid: ${String(ee["provider"])}`);
|
|
2462
|
+
if (ee["provider_id"] !== void 0 && typeof ee["provider_id"] !== "string")
|
|
2463
|
+
push(`edge[${i}].provider_id must be a string`);
|
|
2437
2464
|
if (typeof ee["source"] === "string" && !ids.has(ee["source"]))
|
|
2438
2465
|
push(`edge[${i}].source is not a known node: ${String(ee["source"])}`);
|
|
2439
2466
|
if (ee["candidates"] !== void 0 && !Array.isArray(ee["candidates"]))
|
|
@@ -2454,7 +2481,7 @@ function consumerCandidates(root) {
|
|
|
2454
2481
|
declared = void 0;
|
|
2455
2482
|
}
|
|
2456
2483
|
const extra = Array.isArray(declared) ? declared.filter(
|
|
2457
|
-
(p) => typeof p === "string" && p !== "" && !
|
|
2484
|
+
(p) => typeof p === "string" && p !== "" && !path5.isAbsolute(p) && !path5.normalize(p).startsWith("..")
|
|
2458
2485
|
) : [];
|
|
2459
2486
|
return [...CONSUMER_CANDIDATES, ...extra.filter((p) => !CONSUMER_CANDIDATES.includes(p))];
|
|
2460
2487
|
}
|
|
@@ -2511,18 +2538,18 @@ function looksLikeGraph(p) {
|
|
|
2511
2538
|
}
|
|
2512
2539
|
}
|
|
2513
2540
|
function detectSources(root, nativeCache) {
|
|
2514
|
-
const abs =
|
|
2541
|
+
const abs = path5.resolve(root);
|
|
2515
2542
|
const out = [];
|
|
2516
2543
|
for (const rel2 of consumerCandidates(abs)) {
|
|
2517
|
-
const p =
|
|
2544
|
+
const p = path5.join(abs, rel2);
|
|
2518
2545
|
if (fs4.existsSync(p)) {
|
|
2519
2546
|
const { ok, sha } = looksLikeGraph(p);
|
|
2520
2547
|
if (ok) out.push({ kind: "consumer", path: p, present: true, ...freshness(abs, p, sha) });
|
|
2521
2548
|
}
|
|
2522
2549
|
}
|
|
2523
|
-
const scipCandidates = [
|
|
2550
|
+
const scipCandidates = [path5.join(abs, "index.scip")];
|
|
2524
2551
|
try {
|
|
2525
|
-
for (const e of fs4.readdirSync(abs)) if (e.endsWith(".scip")) scipCandidates.push(
|
|
2552
|
+
for (const e of fs4.readdirSync(abs)) if (e.endsWith(".scip")) scipCandidates.push(path5.join(abs, e));
|
|
2526
2553
|
} catch {
|
|
2527
2554
|
}
|
|
2528
2555
|
const scip = scipCandidates.find((p) => fs4.existsSync(p));
|
|
@@ -2537,7 +2564,6 @@ function pickSource(verdicts) {
|
|
|
2537
2564
|
if (native) return native;
|
|
2538
2565
|
return verdicts.find((v) => v.kind === "consumer") ?? null;
|
|
2539
2566
|
}
|
|
2540
|
-
var NATIVE_CACHE_REL = path4.join("agents", "runtime", "state", "code-graph-v1.json");
|
|
2541
2567
|
function hasUncommittedIndexedEdit(root) {
|
|
2542
2568
|
let out;
|
|
2543
2569
|
try {
|
|
@@ -2570,7 +2596,7 @@ function hasUncommittedIndexedEdit(root) {
|
|
|
2570
2596
|
return false;
|
|
2571
2597
|
}
|
|
2572
2598
|
function graphState(root, nativeCache) {
|
|
2573
|
-
const picked = pickSource(detectSources(root, nativeCache ??
|
|
2599
|
+
const picked = pickSource(detectSources(root, nativeCache ?? projectHome(root).cachePath));
|
|
2574
2600
|
if (!picked) return "absent";
|
|
2575
2601
|
if (picked.stale === true) {
|
|
2576
2602
|
const behind = picked.commits_behind;
|
|
@@ -2584,12 +2610,12 @@ import * as fs6 from "node:fs";
|
|
|
2584
2610
|
|
|
2585
2611
|
// src/scripts/code_graph/sqlite_store.ts
|
|
2586
2612
|
import * as fs5 from "node:fs";
|
|
2587
|
-
var GRAPH_STORE_VERSION =
|
|
2613
|
+
var GRAPH_STORE_VERSION = 6;
|
|
2588
2614
|
var INDEXED_READ_MIN_EDGES = 5e4;
|
|
2589
2615
|
function sqliteTwinPath(jsonPath) {
|
|
2590
2616
|
return jsonPath.endsWith(".json") ? `${jsonPath.slice(0, -5)}.sqlite3` : `${jsonPath}.sqlite3`;
|
|
2591
2617
|
}
|
|
2592
|
-
function emitSqliteTwin(graph,
|
|
2618
|
+
function emitSqliteTwin(graph, jsonPath) {
|
|
2593
2619
|
if (!isSqliteAvailableSync()) return false;
|
|
2594
2620
|
const twin = sqliteTwinPath(jsonPath);
|
|
2595
2621
|
const tmp = `${twin}.tmp-${process.pid}`;
|
|
@@ -2606,14 +2632,13 @@ function emitSqliteTwin(graph, serialized, jsonPath) {
|
|
|
2606
2632
|
try {
|
|
2607
2633
|
db.exec("PRAGMA journal_mode = MEMORY");
|
|
2608
2634
|
db.exec(
|
|
2609
|
-
"CREATE TABLE meta (key TEXT PRIMARY KEY, value TEXT NOT NULL);CREATE TABLE nodes (id TEXT PRIMARY KEY, label TEXT NOT NULL, kind TEXT, source_file TEXT, l0 INTEGER, l1 INTEGER, l2 INTEGER, l3 INTEGER);CREATE TABLE edges (source TEXT NOT NULL, target TEXT NOT NULL, relation TEXT NOT NULL, confidence TEXT NOT NULL, candidates TEXT, ambiguity_reason TEXT, resolved_via TEXT, provider TEXT);CREATE INDEX edges_source ON edges(source);CREATE INDEX edges_target ON edges(target);CREATE INDEX nodes_label ON nodes(label);CREATE INDEX nodes_source_file ON nodes(source_file);"
|
|
2635
|
+
"CREATE TABLE meta (key TEXT PRIMARY KEY, value TEXT NOT NULL);CREATE TABLE nodes (id TEXT PRIMARY KEY, label TEXT NOT NULL, kind TEXT, source_file TEXT, l0 INTEGER, l1 INTEGER, l2 INTEGER, l3 INTEGER);CREATE TABLE edges (source TEXT NOT NULL, target TEXT NOT NULL, relation TEXT NOT NULL, confidence TEXT NOT NULL, candidates TEXT, ambiguity_reason TEXT, resolved_via TEXT, provider TEXT, provider_id TEXT);CREATE INDEX edges_source ON edges(source);CREATE INDEX edges_target ON edges(target);CREATE INDEX nodes_label ON nodes(label);CREATE INDEX nodes_source_file ON nodes(source_file);"
|
|
2610
2636
|
);
|
|
2611
2637
|
db.exec("BEGIN");
|
|
2612
2638
|
const meta = db.prepare("INSERT INTO meta (key, value) VALUES (?, ?)");
|
|
2613
2639
|
meta.run("source_checksum", graph.source_checksum);
|
|
2614
2640
|
meta.run("json_size", String(stat.size));
|
|
2615
2641
|
meta.run("json_mtime_ms", String(stat.mtimeMs));
|
|
2616
|
-
meta.run("graph_json", serialized);
|
|
2617
2642
|
meta.run("node_count", String(graph.nodes.length));
|
|
2618
2643
|
meta.run("edge_count", String(graph.edges.length));
|
|
2619
2644
|
const insNode = db.prepare(
|
|
@@ -2633,7 +2658,7 @@ function emitSqliteTwin(graph, serialized, jsonPath) {
|
|
|
2633
2658
|
);
|
|
2634
2659
|
}
|
|
2635
2660
|
const insEdge = db.prepare(
|
|
2636
|
-
"INSERT INTO edges (source, target, relation, confidence, candidates, ambiguity_reason, resolved_via, provider) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"
|
|
2661
|
+
"INSERT INTO edges (source, target, relation, confidence, candidates, ambiguity_reason, resolved_via, provider, provider_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"
|
|
2637
2662
|
);
|
|
2638
2663
|
for (const e of graph.edges) {
|
|
2639
2664
|
insEdge.run(
|
|
@@ -2644,7 +2669,8 @@ function emitSqliteTwin(graph, serialized, jsonPath) {
|
|
|
2644
2669
|
e.candidates ? JSON.stringify(e.candidates) : null,
|
|
2645
2670
|
e.ambiguity_reason ?? null,
|
|
2646
2671
|
e.resolved_via,
|
|
2647
|
-
e.provider
|
|
2672
|
+
e.provider,
|
|
2673
|
+
e.provider_id ?? null
|
|
2648
2674
|
);
|
|
2649
2675
|
}
|
|
2650
2676
|
db.exec("COMMIT");
|
|
@@ -2661,35 +2687,6 @@ function emitSqliteTwin(graph, serialized, jsonPath) {
|
|
|
2661
2687
|
return false;
|
|
2662
2688
|
}
|
|
2663
2689
|
}
|
|
2664
|
-
function loadSerializedFromTwin(jsonPath) {
|
|
2665
|
-
if (!isSqliteAvailableSync()) return null;
|
|
2666
|
-
const twin = sqliteTwinPath(jsonPath);
|
|
2667
|
-
if (!fs5.existsSync(twin)) return null;
|
|
2668
|
-
let stat;
|
|
2669
|
-
try {
|
|
2670
|
-
stat = fs5.statSync(jsonPath);
|
|
2671
|
-
} catch {
|
|
2672
|
-
return null;
|
|
2673
|
-
}
|
|
2674
|
-
try {
|
|
2675
|
-
const { DatabaseSync } = loadSqliteSync("code_graph.sqlite_store");
|
|
2676
|
-
const db = new DatabaseSync(twin, { readOnly: true });
|
|
2677
|
-
try {
|
|
2678
|
-
if (readUserVersion(db) !== GRAPH_STORE_VERSION) return null;
|
|
2679
|
-
const rows = db.prepare("SELECT key, value FROM meta").all();
|
|
2680
|
-
const meta = new Map(rows.map((r) => [r.key, r.value]));
|
|
2681
|
-
if (meta.get("json_size") !== String(stat.size)) return null;
|
|
2682
|
-
if (meta.get("json_mtime_ms") !== String(stat.mtimeMs)) return null;
|
|
2683
|
-
const serialized = meta.get("graph_json");
|
|
2684
|
-
return serialized && serialized.length > 0 ? serialized : null;
|
|
2685
|
-
} finally {
|
|
2686
|
-
db.close();
|
|
2687
|
-
}
|
|
2688
|
-
} catch {
|
|
2689
|
-
fs5.rmSync(twin, { force: true });
|
|
2690
|
-
return null;
|
|
2691
|
-
}
|
|
2692
|
-
}
|
|
2693
2690
|
function toNode(r) {
|
|
2694
2691
|
const loc = [r.l0, r.l1, r.l2, r.l3].filter((v) => typeof v === "number");
|
|
2695
2692
|
return {
|
|
@@ -2719,6 +2716,7 @@ function toEdge(r) {
|
|
|
2719
2716
|
if (r.ambiguity_reason === "receiver-unknown" || r.ambiguity_reason === "hierarchy-unresolved") {
|
|
2720
2717
|
e.ambiguity_reason = r.ambiguity_reason;
|
|
2721
2718
|
}
|
|
2719
|
+
if (r.provider_id) e.provider_id = r.provider_id;
|
|
2722
2720
|
return e;
|
|
2723
2721
|
}
|
|
2724
2722
|
function openGraphIndex(jsonPath) {
|
|
@@ -2953,12 +2951,12 @@ function indexBackedGraph(index, source, answeredBy) {
|
|
|
2953
2951
|
}
|
|
2954
2952
|
function loadGraph(graphPath, source = graphPath) {
|
|
2955
2953
|
const index = openGraphIndex(graphPath);
|
|
2954
|
+
const twinCurrent = index !== null;
|
|
2956
2955
|
if (index) {
|
|
2957
2956
|
if (index.edgeCount >= INDEXED_READ_MIN_EDGES) return indexBackedGraph(index, source, graphPath);
|
|
2958
2957
|
index.close();
|
|
2959
2958
|
}
|
|
2960
|
-
const
|
|
2961
|
-
const raw = fromTwin ?? fs6.readFileSync(graphPath, "utf-8");
|
|
2959
|
+
const raw = fs6.readFileSync(graphPath, "utf-8");
|
|
2962
2960
|
const parsed = JSON.parse(raw);
|
|
2963
2961
|
let foreignAdapted = false;
|
|
2964
2962
|
let candidate = parsed;
|
|
@@ -2972,8 +2970,8 @@ function loadGraph(graphPath, source = graphPath) {
|
|
|
2972
2970
|
const v = validateGraph(candidate);
|
|
2973
2971
|
if (!v.ok) throw new Error(`invalid graph at ${graphPath}: ${v.errors.slice(0, 3).join("; ")}`);
|
|
2974
2972
|
const graph = candidate;
|
|
2975
|
-
if (
|
|
2976
|
-
emitSqliteTwin(graph,
|
|
2973
|
+
if (!twinCurrent && !foreignAdapted) {
|
|
2974
|
+
emitSqliteTwin(graph, graphPath);
|
|
2977
2975
|
}
|
|
2978
2976
|
const byId = new Map(graph.nodes.map((n) => [n.id, n]));
|
|
2979
2977
|
const outM = /* @__PURE__ */ new Map();
|
|
@@ -3018,7 +3016,7 @@ function resolveSeeds(g, seed, limit = 5) {
|
|
|
3018
3016
|
}
|
|
3019
3017
|
|
|
3020
3018
|
// src/scripts/code_graph/verbs.ts
|
|
3021
|
-
import * as
|
|
3019
|
+
import * as path6 from "node:path";
|
|
3022
3020
|
function isAcceptedEdge(e) {
|
|
3023
3021
|
return isStatedResolution(e.resolved_via);
|
|
3024
3022
|
}
|
|
@@ -3059,7 +3057,7 @@ function seedsForFiles(g, files) {
|
|
|
3059
3057
|
continue;
|
|
3060
3058
|
}
|
|
3061
3059
|
if (symbols.some((s) => s.startsWith(`${f}#`))) continue;
|
|
3062
|
-
if (EXT_LANG[
|
|
3060
|
+
if (EXT_LANG[path6.extname(f).toLowerCase()] === void 0) notIndexed.push(f);
|
|
3063
3061
|
else unresolved.push(f);
|
|
3064
3062
|
}
|
|
3065
3063
|
return {
|
|
@@ -3157,12 +3155,12 @@ var MAX_PATHS = 5;
|
|
|
3157
3155
|
var OUTSIDE_WORKSPACE = "<outside-workspace>";
|
|
3158
3156
|
var MAX_ROWS_PER_SESSION = 200;
|
|
3159
3157
|
function feederFile(workspaceRoot, sessionKey) {
|
|
3160
|
-
return
|
|
3158
|
+
return path7.join(workspaceRoot, "agents", "state", "graph-feeder", `${sessionKey}.jsonl`);
|
|
3161
3159
|
}
|
|
3162
3160
|
function toRepoRelative(root, paths) {
|
|
3163
3161
|
let realRoot = null;
|
|
3164
3162
|
return paths.map((p) => {
|
|
3165
|
-
if (!
|
|
3163
|
+
if (!path7.isAbsolute(p)) return p;
|
|
3166
3164
|
const raw = _relativeInside(root, p);
|
|
3167
3165
|
if (raw !== null) return raw;
|
|
3168
3166
|
realRoot ??= _resolveReal(root);
|
|
@@ -3172,32 +3170,32 @@ function toRepoRelative(root, paths) {
|
|
|
3172
3170
|
function _relativeInside(from, to) {
|
|
3173
3171
|
let rel2;
|
|
3174
3172
|
try {
|
|
3175
|
-
rel2 =
|
|
3173
|
+
rel2 = path7.relative(from, to);
|
|
3176
3174
|
} catch {
|
|
3177
3175
|
return null;
|
|
3178
3176
|
}
|
|
3179
3177
|
if (rel2 === "") return ".";
|
|
3180
|
-
if (rel2 === ".." || rel2.startsWith(`..${
|
|
3181
|
-
return rel2.split(
|
|
3178
|
+
if (rel2 === ".." || rel2.startsWith(`..${path7.sep}`) || path7.isAbsolute(rel2)) return null;
|
|
3179
|
+
return rel2.split(path7.sep).join("/");
|
|
3182
3180
|
}
|
|
3183
3181
|
function _resolveReal(p) {
|
|
3184
|
-
const abs =
|
|
3182
|
+
const abs = path7.resolve(p);
|
|
3185
3183
|
const tail = [];
|
|
3186
3184
|
let cur = abs;
|
|
3187
3185
|
for (; ; ) {
|
|
3188
3186
|
try {
|
|
3189
3187
|
const real = fs7.realpathSync(cur);
|
|
3190
|
-
return tail.length === 0 ? real :
|
|
3188
|
+
return tail.length === 0 ? real : path7.join(real, ...[...tail].reverse());
|
|
3191
3189
|
} catch {
|
|
3192
|
-
const parent =
|
|
3190
|
+
const parent = path7.dirname(cur);
|
|
3193
3191
|
if (parent === cur) return abs;
|
|
3194
|
-
tail.push(
|
|
3192
|
+
tail.push(path7.basename(cur));
|
|
3195
3193
|
cur = parent;
|
|
3196
3194
|
}
|
|
3197
3195
|
}
|
|
3198
3196
|
}
|
|
3199
3197
|
function _escapesWorkspace(p) {
|
|
3200
|
-
return
|
|
3198
|
+
return path7.isAbsolute(p) || path7.win32.isAbsolute(p) || p === ".." || p.startsWith("../") || p.startsWith(`..${path7.sep}`);
|
|
3201
3199
|
}
|
|
3202
3200
|
function graphUntestedVerdict(root, state, paths) {
|
|
3203
3201
|
const none = { verdict: null, untested: 0, tested: 0 };
|
|
@@ -3205,14 +3203,14 @@ function graphUntestedVerdict(root, state, paths) {
|
|
|
3205
3203
|
if (paths.length === 0) return none;
|
|
3206
3204
|
let picked;
|
|
3207
3205
|
try {
|
|
3208
|
-
picked = pickSource(detectSources(root,
|
|
3206
|
+
picked = pickSource(detectSources(root, projectHome(root).cachePath));
|
|
3209
3207
|
} catch {
|
|
3210
3208
|
return none;
|
|
3211
3209
|
}
|
|
3212
3210
|
if (!picked || picked.kind === "scip") return none;
|
|
3213
3211
|
let g;
|
|
3214
3212
|
try {
|
|
3215
|
-
g = loadGraph(picked.path, `${picked.kind}:${
|
|
3213
|
+
g = loadGraph(picked.path, `${picked.kind}:${path7.relative(root, picked.path)}`);
|
|
3216
3214
|
} catch {
|
|
3217
3215
|
return none;
|
|
3218
3216
|
}
|
|
@@ -3242,7 +3240,7 @@ function appendFeederRow(workspaceRoot, sessionKey, row) {
|
|
|
3242
3240
|
} catch {
|
|
3243
3241
|
}
|
|
3244
3242
|
if (existing >= MAX_ROWS_PER_SESSION) return;
|
|
3245
|
-
fs7.mkdirSync(
|
|
3243
|
+
fs7.mkdirSync(path7.dirname(file), { recursive: true });
|
|
3246
3244
|
fs7.appendFileSync(file, `${JSON.stringify(row)}
|
|
3247
3245
|
`);
|
|
3248
3246
|
} catch {
|
|
@@ -3292,7 +3290,7 @@ function buildFeederRow(input) {
|
|
|
3292
3290
|
// src/scripts/hooks/svg_obligation.ts
|
|
3293
3291
|
import * as crypto from "node:crypto";
|
|
3294
3292
|
import * as fs8 from "node:fs";
|
|
3295
|
-
import * as
|
|
3293
|
+
import * as path8 from "node:path";
|
|
3296
3294
|
var EDIT_TOOLS = /* @__PURE__ */ new Set(["Edit", "Write", "MultiEdit", "NotebookEdit"]);
|
|
3297
3295
|
var PLANTED_PREFIXES = [
|
|
3298
3296
|
"tests/design-artifacts/fixtures/",
|
|
@@ -3303,9 +3301,9 @@ function hasErrorFinding(m) {
|
|
|
3303
3301
|
return Array.isArray(f) && f.some((x) => x?.severity === "error");
|
|
3304
3302
|
}
|
|
3305
3303
|
var rel = (root, p) => {
|
|
3306
|
-
const slashed = p.split(
|
|
3307
|
-
if (!
|
|
3308
|
-
const inside =
|
|
3304
|
+
const slashed = p.split(path8.sep).join("/");
|
|
3305
|
+
if (!path8.isAbsolute(p)) return path8.posix.normalize(slashed).replace(/^\.\//, "");
|
|
3306
|
+
const inside = path8.relative(root, p).split(path8.sep).join("/");
|
|
3309
3307
|
return inside === "" || inside.startsWith("../") ? slashed : inside;
|
|
3310
3308
|
};
|
|
3311
3309
|
function isPlantedFixture(relPath, root = "") {
|
|
@@ -3313,7 +3311,7 @@ function isPlantedFixture(relPath, root = "") {
|
|
|
3313
3311
|
return PLANTED_PREFIXES.some((prefix) => norm.startsWith(prefix));
|
|
3314
3312
|
}
|
|
3315
3313
|
function readAssetManifests(root) {
|
|
3316
|
-
const dir =
|
|
3314
|
+
const dir = path8.join(root, RENDER_REL);
|
|
3317
3315
|
let entries;
|
|
3318
3316
|
try {
|
|
3319
3317
|
entries = fs8.readdirSync(dir);
|
|
@@ -3324,7 +3322,7 @@ function readAssetManifests(root) {
|
|
|
3324
3322
|
for (const name of entries) {
|
|
3325
3323
|
let raw;
|
|
3326
3324
|
try {
|
|
3327
|
-
raw = fs8.readFileSync(
|
|
3325
|
+
raw = fs8.readFileSync(path8.join(dir, name, "manifest.json"), "utf8");
|
|
3328
3326
|
} catch {
|
|
3329
3327
|
continue;
|
|
3330
3328
|
}
|
|
@@ -3352,7 +3350,7 @@ var TRANSCRIPT_FALLBACK_REASON = "transcript fallback: no readable `post_tool_us
|
|
|
3352
3350
|
function recordVerdict(root, abs, digest, records) {
|
|
3353
3351
|
let changed = false;
|
|
3354
3352
|
for (const r of records) {
|
|
3355
|
-
if (
|
|
3353
|
+
if (path8.resolve(root, r.file) !== abs || r.file_digest !== digest) continue;
|
|
3356
3354
|
const read = recordedManifest(root, r);
|
|
3357
3355
|
if (read === null) continue;
|
|
3358
3356
|
if ("changed" in read) {
|
|
@@ -3375,7 +3373,7 @@ function readSvgObligations(root, inputs) {
|
|
|
3375
3373
|
if (seen.has(relPath)) continue;
|
|
3376
3374
|
seen.add(relPath);
|
|
3377
3375
|
if (isPlantedFixture(relPath, root)) continue;
|
|
3378
|
-
const abs =
|
|
3376
|
+
const abs = path8.isAbsolute(raw) ? raw : path8.join(root, relPath);
|
|
3379
3377
|
let bytes;
|
|
3380
3378
|
try {
|
|
3381
3379
|
bytes = fs8.readFileSync(abs);
|
|
@@ -3384,7 +3382,7 @@ function readSvgObligations(root, inputs) {
|
|
|
3384
3382
|
}
|
|
3385
3383
|
const digest = crypto.createHash("sha256").update(bytes).digest("hex");
|
|
3386
3384
|
if (Array.isArray(inputs.recorded)) {
|
|
3387
|
-
const verdict = recordVerdict(root,
|
|
3385
|
+
const verdict = recordVerdict(root, path8.resolve(root, abs), digest, inputs.recorded);
|
|
3388
3386
|
if (verdict === "verified" || verdict === "static-only") discharged.push({ file: relPath, kind: verdict });
|
|
3389
3387
|
else open.push({ file: relPath, reason: verdict });
|
|
3390
3388
|
continue;
|
|
@@ -3419,14 +3417,14 @@ function readSvgObligations(root, inputs) {
|
|
|
3419
3417
|
function renderNames(commands, relPath) {
|
|
3420
3418
|
const base = relPath.split("/").pop() ?? relPath;
|
|
3421
3419
|
return commands.some((c) => {
|
|
3422
|
-
const slashed = c.split(
|
|
3420
|
+
const slashed = c.split(path8.sep).join("/");
|
|
3423
3421
|
const bounded = (needle) => new RegExp(`(^|[\\s/'"])${escapeRe(needle)}(\\s|$|['"])`).test(slashed);
|
|
3424
3422
|
return bounded(relPath) || bounded(base);
|
|
3425
3423
|
});
|
|
3426
3424
|
}
|
|
3427
3425
|
function writesRenderDir(command) {
|
|
3428
3426
|
if (isPureRender(command)) return false;
|
|
3429
|
-
const slashed = command.split(
|
|
3427
|
+
const slashed = command.split(path8.sep).join("/");
|
|
3430
3428
|
const names = /(^|[\s/'"])(render\/|manifest\.json\b)/.test(slashed) || slashed.includes("state/render");
|
|
3431
3429
|
const writes = />(?!&)|\b(tee|sponge)\b|\b(cp|mv|ln|install|rsync|dd)\s|\bsed\s+-i|\bwriteFile|\b(python[\d.]*|perl|ruby|node|deno|bun|php|osascript)\b/.test(
|
|
3432
3430
|
slashed.replace(/\s\d?>&\d\b/g, " ").replace(/\s2>\s*\/dev\/null\b/g, " ")
|
|
@@ -3455,7 +3453,7 @@ function openSvgObligation(workspaceRoot, toolCalls, recordedRaw = null) {
|
|
|
3455
3453
|
}
|
|
3456
3454
|
return { path: p, rendered };
|
|
3457
3455
|
});
|
|
3458
|
-
const renderDir = RENDER_REL.split(
|
|
3456
|
+
const renderDir = RENDER_REL.split(path8.sep).join("/");
|
|
3459
3457
|
const renderDirTampered = toolCalls.some((c) => {
|
|
3460
3458
|
if (EDIT_TOOLS.has(c.name) && c.path !== void 0) {
|
|
3461
3459
|
return rel(workspaceRoot, c.path).startsWith(`${renderDir}/`);
|
|
@@ -3550,13 +3548,13 @@ import { spawnSync as spawnSync2 } from "node:child_process";
|
|
|
3550
3548
|
import * as crypto2 from "node:crypto";
|
|
3551
3549
|
import * as fs10 from "node:fs";
|
|
3552
3550
|
import * as os from "node:os";
|
|
3553
|
-
import * as
|
|
3551
|
+
import * as path10 from "node:path";
|
|
3554
3552
|
import { fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL4 } from "node:url";
|
|
3555
3553
|
|
|
3556
3554
|
// src/scripts/_lib/review_baseline.ts
|
|
3557
3555
|
import { spawnSync } from "node:child_process";
|
|
3558
3556
|
import * as fs9 from "node:fs";
|
|
3559
|
-
import * as
|
|
3557
|
+
import * as path9 from "node:path";
|
|
3560
3558
|
function currentHeadSha(cwd) {
|
|
3561
3559
|
try {
|
|
3562
3560
|
const r = spawnSync("git", ["rev-parse", "HEAD"], { cwd, encoding: "utf8" });
|
|
@@ -3567,12 +3565,12 @@ function currentHeadSha(cwd) {
|
|
|
3567
3565
|
return null;
|
|
3568
3566
|
}
|
|
3569
3567
|
}
|
|
3570
|
-
var BASELINE_STATE_REL =
|
|
3568
|
+
var BASELINE_STATE_REL = path9.join("agents", "runtime", "state", "review-baseline");
|
|
3571
3569
|
function baselineStateDir(workspaceRoot) {
|
|
3572
|
-
return
|
|
3570
|
+
return path9.join(workspaceRoot, BASELINE_STATE_REL);
|
|
3573
3571
|
}
|
|
3574
3572
|
function baselineStateFile(workspaceRoot, sessionKey) {
|
|
3575
|
-
return
|
|
3573
|
+
return path9.join(baselineStateDir(workspaceRoot), `${sessionKey}.json`);
|
|
3576
3574
|
}
|
|
3577
3575
|
function parseBaseline(raw) {
|
|
3578
3576
|
let decoded;
|
|
@@ -3712,8 +3710,8 @@ function isSafeTranscriptPath(rawPath, opts = {}) {
|
|
|
3712
3710
|
try {
|
|
3713
3711
|
const realHome = fs10.realpathSync(homeDir);
|
|
3714
3712
|
const realPath = fs10.realpathSync(rawPath);
|
|
3715
|
-
const relative6 =
|
|
3716
|
-
if (relative6 === "" || relative6.startsWith("..") ||
|
|
3713
|
+
const relative6 = path10.relative(realHome, realPath);
|
|
3714
|
+
if (relative6 === "" || relative6.startsWith("..") || path10.isAbsolute(relative6)) {
|
|
3717
3715
|
return false;
|
|
3718
3716
|
}
|
|
3719
3717
|
const { size } = fs10.statSync(realPath);
|
|
@@ -3774,7 +3772,7 @@ var BINARY_PROBE_BYTES = 8e3;
|
|
|
3774
3772
|
var UNTRACKED_FILE_READ_CAP_BYTES = 8 * 1024 * 1024;
|
|
3775
3773
|
function untrackedFileLineCount(cwd, relPath) {
|
|
3776
3774
|
try {
|
|
3777
|
-
const abs =
|
|
3775
|
+
const abs = path10.resolve(cwd, relPath);
|
|
3778
3776
|
const size = fs10.statSync(abs).size;
|
|
3779
3777
|
if (size === 0) return 0;
|
|
3780
3778
|
if (size > UNTRACKED_FILE_READ_CAP_BYTES) {
|
|
@@ -3871,19 +3869,19 @@ function appendReviewSkippedTelemetry(workspaceRoot, diffLines, mutationMeasure,
|
|
|
3871
3869
|
});
|
|
3872
3870
|
if (errors.length || line === null) return;
|
|
3873
3871
|
try {
|
|
3874
|
-
const dir =
|
|
3872
|
+
const dir = path10.join(workspaceRoot, "agents", "runtime", "state", "audit");
|
|
3875
3873
|
fs10.mkdirSync(dir, { recursive: true });
|
|
3876
|
-
const file =
|
|
3874
|
+
const file = path10.join(dir, `${ts.slice(0, 7)}.jsonl`);
|
|
3877
3875
|
fs10.appendFileSync(file, `${JSON.stringify(line)}
|
|
3878
3876
|
`, "utf8");
|
|
3879
3877
|
} catch {
|
|
3880
3878
|
}
|
|
3881
3879
|
}
|
|
3882
3880
|
function sessionStateDir(workspaceRoot) {
|
|
3883
|
-
return
|
|
3881
|
+
return path10.join(workspaceRoot, "agents", "runtime", "state", "end-review-nudge");
|
|
3884
3882
|
}
|
|
3885
3883
|
function sessionStateFile(workspaceRoot, sessionKey) {
|
|
3886
|
-
return
|
|
3884
|
+
return path10.join(sessionStateDir(workspaceRoot), `${sessionKey}.json`);
|
|
3887
3885
|
}
|
|
3888
3886
|
function deriveSessionKey2(envelope, payload) {
|
|
3889
3887
|
const raw = str(envelope["session_id"]) || str(payload["transcript_path"] ?? payload["transcriptPath"]);
|
|
@@ -3989,13 +3987,13 @@ function _isCliEntry4() {
|
|
|
3989
3987
|
if (process.argv[1] === void 0) {
|
|
3990
3988
|
return false;
|
|
3991
3989
|
}
|
|
3992
|
-
const argvUrl = pathToFileURL4(
|
|
3990
|
+
const argvUrl = pathToFileURL4(path10.resolve(process.argv[1])).href;
|
|
3993
3991
|
if (import.meta.url === argvUrl) {
|
|
3994
3992
|
return true;
|
|
3995
3993
|
}
|
|
3996
3994
|
try {
|
|
3997
3995
|
const here = fs10.realpathSync(fileURLToPath4(import.meta.url));
|
|
3998
|
-
const argv = fs10.realpathSync(
|
|
3996
|
+
const argv = fs10.realpathSync(path10.resolve(process.argv[1]));
|
|
3999
3997
|
return here === argv;
|
|
4000
3998
|
} catch {
|
|
4001
3999
|
return false;
|
|
@@ -4206,7 +4204,7 @@ function detectPromissory(reply) {
|
|
|
4206
4204
|
function readCiSettled(workspaceRoot, session_id) {
|
|
4207
4205
|
if (!hasStableSessionId(session_id)) return { seen: false, settled: false };
|
|
4208
4206
|
try {
|
|
4209
|
-
const raw = fs12.readFileSync(
|
|
4207
|
+
const raw = fs12.readFileSync(path11.join(workspaceRoot, statePathFor(session_id)), "utf-8");
|
|
4210
4208
|
const decoded = JSON.parse(raw);
|
|
4211
4209
|
if (!owns_session_state(decoded, session_id)) return { seen: false, settled: false };
|
|
4212
4210
|
if (typeof decoded === "object" && decoded !== null && !Array.isArray(decoded)) {
|
|
@@ -4243,7 +4241,7 @@ function readLanguagePin(workspaceRoot, session_id) {
|
|
|
4243
4241
|
if (!hasStableSessionId(session_id)) return "und";
|
|
4244
4242
|
try {
|
|
4245
4243
|
const raw = fs12.readFileSync(
|
|
4246
|
-
|
|
4244
|
+
path11.join(workspaceRoot, statePathFor2(session_id)),
|
|
4247
4245
|
"utf-8"
|
|
4248
4246
|
);
|
|
4249
4247
|
const decoded = JSON.parse(raw);
|
|
@@ -4576,13 +4574,13 @@ function _isCliEntry5() {
|
|
|
4576
4574
|
if (process.argv[1] === void 0) {
|
|
4577
4575
|
return false;
|
|
4578
4576
|
}
|
|
4579
|
-
const argvUrl = pathToFileURL5(
|
|
4577
|
+
const argvUrl = pathToFileURL5(path11.resolve(process.argv[1])).href;
|
|
4580
4578
|
if (import.meta.url === argvUrl) {
|
|
4581
4579
|
return true;
|
|
4582
4580
|
}
|
|
4583
4581
|
try {
|
|
4584
4582
|
const here = fs12.realpathSync(fileURLToPath5(import.meta.url));
|
|
4585
|
-
const argv = fs12.realpathSync(
|
|
4583
|
+
const argv = fs12.realpathSync(path11.resolve(process.argv[1]));
|
|
4586
4584
|
return here === argv;
|
|
4587
4585
|
} catch {
|
|
4588
4586
|
return false;
|
|
@@ -4596,7 +4594,7 @@ if (_isCliEntry5()) {
|
|
|
4596
4594
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
4597
4595
|
import crypto3 from "node:crypto";
|
|
4598
4596
|
import fs13 from "node:fs";
|
|
4599
|
-
import
|
|
4597
|
+
import path12 from "node:path";
|
|
4600
4598
|
import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL6 } from "node:url";
|
|
4601
4599
|
|
|
4602
4600
|
// src/scripts/_lib/test_delta.ts
|
|
@@ -4615,7 +4613,7 @@ function isTestPath(p) {
|
|
|
4615
4613
|
}
|
|
4616
4614
|
|
|
4617
4615
|
// src/scripts/hooks/evidence_independence.ts
|
|
4618
|
-
var STATE_FILE3 =
|
|
4616
|
+
var STATE_FILE3 = path12.join("agents", "state", "evidence-dispatch.json");
|
|
4619
4617
|
function _isObject5(v) {
|
|
4620
4618
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
4621
4619
|
}
|
|
@@ -4684,7 +4682,7 @@ function extractDispatch(envelope) {
|
|
|
4684
4682
|
function _ledgerStamp(consumer_root, session_id) {
|
|
4685
4683
|
try {
|
|
4686
4684
|
const raw = fs13.readFileSync(
|
|
4687
|
-
|
|
4685
|
+
path12.join(consumer_root, ledgerFileFor(session_id)),
|
|
4688
4686
|
"utf8"
|
|
4689
4687
|
);
|
|
4690
4688
|
const d = JSON.parse(raw);
|
|
@@ -4779,7 +4777,7 @@ function run3(stdin_text, options) {
|
|
|
4779
4777
|
return EXIT_ALLOW;
|
|
4780
4778
|
}
|
|
4781
4779
|
}
|
|
4782
|
-
const target =
|
|
4780
|
+
const target = path12.join(options.consumer_root, STATE_FILE3);
|
|
4783
4781
|
const state = _load(target);
|
|
4784
4782
|
const session_id = typeof envelope["session_id"] === "string" ? envelope["session_id"] : "";
|
|
4785
4783
|
const turnMarker = `${session_id}:${_ledgerStamp(options.consumer_root, session_id)}`;
|
|
@@ -4847,13 +4845,13 @@ function _isCliEntry6() {
|
|
|
4847
4845
|
if (process.argv[1] === void 0) {
|
|
4848
4846
|
return false;
|
|
4849
4847
|
}
|
|
4850
|
-
const argvUrl = pathToFileURL6(
|
|
4848
|
+
const argvUrl = pathToFileURL6(path12.resolve(process.argv[1])).href;
|
|
4851
4849
|
if (import.meta.url === argvUrl) {
|
|
4852
4850
|
return true;
|
|
4853
4851
|
}
|
|
4854
4852
|
try {
|
|
4855
4853
|
const here = fs13.realpathSync(fileURLToPath6(import.meta.url));
|
|
4856
|
-
const argv = fs13.realpathSync(
|
|
4854
|
+
const argv = fs13.realpathSync(path12.resolve(process.argv[1]));
|
|
4857
4855
|
return here === argv;
|
|
4858
4856
|
} catch {
|
|
4859
4857
|
return false;
|
|
@@ -4865,7 +4863,7 @@ if (_isCliEntry6()) {
|
|
|
4865
4863
|
|
|
4866
4864
|
// src/scripts/hooks/delegation_nudge_hook.ts
|
|
4867
4865
|
import fs16 from "node:fs";
|
|
4868
|
-
import
|
|
4866
|
+
import path14 from "node:path";
|
|
4869
4867
|
import { fileURLToPath as fileURLToPath7, pathToFileURL as pathToFileURL7 } from "node:url";
|
|
4870
4868
|
|
|
4871
4869
|
// src/scripts/_lib/auto_dispatch.ts
|
|
@@ -5199,11 +5197,11 @@ import * as fs15 from "node:fs";
|
|
|
5199
5197
|
|
|
5200
5198
|
// src/scripts/ai_council/kind_flip_state.ts
|
|
5201
5199
|
import * as fs14 from "node:fs";
|
|
5202
|
-
import * as
|
|
5203
|
-
var KIND_FLIPS_RELPATH =
|
|
5200
|
+
import * as path13 from "node:path";
|
|
5201
|
+
var KIND_FLIPS_RELPATH = path13.join("agents", "runtime", "state", "hand-kind-flips.json");
|
|
5204
5202
|
function isKindFlipped(stateRoot, kind) {
|
|
5205
5203
|
try {
|
|
5206
|
-
const raw = JSON.parse(fs14.readFileSync(
|
|
5204
|
+
const raw = JSON.parse(fs14.readFileSync(path13.join(stateRoot, KIND_FLIPS_RELPATH), "utf8"));
|
|
5207
5205
|
return raw.kinds?.[kind]?.route === "free";
|
|
5208
5206
|
} catch {
|
|
5209
5207
|
return false;
|
|
@@ -5503,13 +5501,13 @@ function _isCliEntry7() {
|
|
|
5503
5501
|
if (process.argv[1] === void 0) {
|
|
5504
5502
|
return false;
|
|
5505
5503
|
}
|
|
5506
|
-
const argvUrl = pathToFileURL7(
|
|
5504
|
+
const argvUrl = pathToFileURL7(path14.resolve(process.argv[1])).href;
|
|
5507
5505
|
if (import.meta.url === argvUrl) {
|
|
5508
5506
|
return true;
|
|
5509
5507
|
}
|
|
5510
5508
|
try {
|
|
5511
5509
|
const here = fs16.realpathSync(fileURLToPath7(import.meta.url));
|
|
5512
|
-
const argv = fs16.realpathSync(
|
|
5510
|
+
const argv = fs16.realpathSync(path14.resolve(process.argv[1]));
|
|
5513
5511
|
return here === argv;
|
|
5514
5512
|
} catch {
|
|
5515
5513
|
return false;
|
|
@@ -5520,7 +5518,7 @@ if (_isCliEntry7()) {
|
|
|
5520
5518
|
}
|
|
5521
5519
|
|
|
5522
5520
|
// src/scripts/conformance_scan.ts
|
|
5523
|
-
var REPO_ROOT =
|
|
5521
|
+
var REPO_ROOT = path15.resolve(path15.dirname(fileURLToPath8(import.meta.url)), "..", "..");
|
|
5524
5522
|
var OBSERVED_BAND = { low: 9.1, high: 39.2 };
|
|
5525
5523
|
var BAND_MIN_TURNS = 1978;
|
|
5526
5524
|
var CARRIER_CHANGES = [
|
|
@@ -5886,7 +5884,7 @@ function scanSession(sessionId, lines) {
|
|
|
5886
5884
|
closeWindow();
|
|
5887
5885
|
return report;
|
|
5888
5886
|
}
|
|
5889
|
-
var DEFAULT_RATE_SERIES =
|
|
5887
|
+
var DEFAULT_RATE_SERIES = path15.join(
|
|
5890
5888
|
REPO_ROOT,
|
|
5891
5889
|
"agents",
|
|
5892
5890
|
"runtime",
|
|
@@ -5895,7 +5893,7 @@ var DEFAULT_RATE_SERIES = path14.join(
|
|
|
5895
5893
|
);
|
|
5896
5894
|
function defaultStore(projectDir) {
|
|
5897
5895
|
const slug = projectStoreSlug(projectDir);
|
|
5898
|
-
return
|
|
5896
|
+
return path15.join(process.env["HOME"] ?? "", ".claude", "projects", slug);
|
|
5899
5897
|
}
|
|
5900
5898
|
function _tokens(chars) {
|
|
5901
5899
|
return Math.round(chars / 4);
|
|
@@ -5920,13 +5918,13 @@ function measureDelivered(projectRulesDir, globalRulesDir) {
|
|
|
5920
5918
|
};
|
|
5921
5919
|
}
|
|
5922
5920
|
function storeKey(store) {
|
|
5923
|
-
return createHash4("sha256").update(
|
|
5921
|
+
return createHash4("sha256").update(path15.resolve(store)).digest("hex").slice(0, 12);
|
|
5924
5922
|
}
|
|
5925
5923
|
function scanStore(store, limit) {
|
|
5926
|
-
const files = fs17.readdirSync(store).filter((f) => f.endsWith(".jsonl")).map((f) => ({ f, m: fs17.statSync(
|
|
5924
|
+
const files = fs17.readdirSync(store).filter((f) => f.endsWith(".jsonl")).map((f) => ({ f, m: fs17.statSync(path15.join(store, f)).mtimeMs })).sort((a, b) => b.m - a.m).slice(0, limit).map((x) => x.f);
|
|
5927
5925
|
const per_session = [];
|
|
5928
5926
|
for (const f of files) {
|
|
5929
|
-
const lines = fs17.readFileSync(
|
|
5927
|
+
const lines = fs17.readFileSync(path15.join(store, f), "utf8").split("\n");
|
|
5930
5928
|
const r = scanSession(f.replace(/\.jsonl$/, "").slice(0, 8), lines);
|
|
5931
5929
|
if (r.assistant_turns > 0) {
|
|
5932
5930
|
per_session.push(r);
|
|
@@ -5954,10 +5952,10 @@ function scanStore(store, limit) {
|
|
|
5954
5952
|
const task_completeness_rate_pct = completeness_windows === 0 ? 0 : Number((100 * task_completeness / completeness_windows).toFixed(1));
|
|
5955
5953
|
const era = spansCarrierChange(per_session.map((s) => s.first_at));
|
|
5956
5954
|
const delivered = measureDelivered(
|
|
5957
|
-
|
|
5958
|
-
|
|
5955
|
+
path15.join(REPO_ROOT, ".claude", "rules"),
|
|
5956
|
+
path15.join(process.env["HOME"] ?? os2.homedir(), ".claude", "rules")
|
|
5959
5957
|
);
|
|
5960
|
-
const ownStore =
|
|
5958
|
+
const ownStore = path15.resolve(store) === path15.resolve(defaultStore(REPO_ROOT));
|
|
5961
5959
|
return {
|
|
5962
5960
|
scanned_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5963
5961
|
store,
|
|
@@ -5987,7 +5985,7 @@ function scanStore(store, limit) {
|
|
|
5987
5985
|
};
|
|
5988
5986
|
}
|
|
5989
5987
|
function recordRate(file, scanned_at, rate) {
|
|
5990
|
-
fs17.mkdirSync(
|
|
5988
|
+
fs17.mkdirSync(path15.dirname(file), { recursive: true });
|
|
5991
5989
|
fs17.appendFileSync(file, `${JSON.stringify({ measured_at: scanned_at, ...rate })}
|
|
5992
5990
|
`, "utf8");
|
|
5993
5991
|
}
|
|
@@ -6166,13 +6164,13 @@ function _isCliEntry8() {
|
|
|
6166
6164
|
if (process.argv[1] === void 0) {
|
|
6167
6165
|
return false;
|
|
6168
6166
|
}
|
|
6169
|
-
const argvUrl = pathToFileURL8(
|
|
6167
|
+
const argvUrl = pathToFileURL8(path15.resolve(process.argv[1])).href;
|
|
6170
6168
|
if (import.meta.url === argvUrl) {
|
|
6171
6169
|
return true;
|
|
6172
6170
|
}
|
|
6173
6171
|
try {
|
|
6174
6172
|
const here = fs17.realpathSync(fileURLToPath8(import.meta.url));
|
|
6175
|
-
const argv = fs17.realpathSync(
|
|
6173
|
+
const argv = fs17.realpathSync(path15.resolve(process.argv[1]));
|
|
6176
6174
|
return here === argv;
|
|
6177
6175
|
} catch {
|
|
6178
6176
|
return false;
|
|
@@ -6185,14 +6183,14 @@ if (_isCliEntry8()) {
|
|
|
6185
6183
|
// src/scripts/report_carrier_divergence.ts
|
|
6186
6184
|
import * as fs18 from "node:fs";
|
|
6187
6185
|
import * as os3 from "node:os";
|
|
6188
|
-
import * as
|
|
6186
|
+
import * as path16 from "node:path";
|
|
6189
6187
|
import process2 from "node:process";
|
|
6190
6188
|
import { fileURLToPath as fileURLToPath9, pathToFileURL as pathToFileURL9 } from "node:url";
|
|
6191
6189
|
var _HERE2 = fileURLToPath9(import.meta.url);
|
|
6192
|
-
var REPO_ROOT2 =
|
|
6193
|
-
var PROJECT_RULES =
|
|
6194
|
-
var PROJECTION_SOURCE =
|
|
6195
|
-
var GLOBAL_RULES =
|
|
6190
|
+
var REPO_ROOT2 = path16.resolve(path16.dirname(_HERE2), "..", "..");
|
|
6191
|
+
var PROJECT_RULES = path16.join(".claude", "rules");
|
|
6192
|
+
var PROJECTION_SOURCE = path16.join("dist", "agent-src", "rules");
|
|
6193
|
+
var GLOBAL_RULES = path16.join(".claude", "rules");
|
|
6196
6194
|
function _listRules(dir) {
|
|
6197
6195
|
try {
|
|
6198
6196
|
return fs18.readdirSync(dir).filter((f) => f.endsWith(".md")).sort();
|
|
@@ -6238,7 +6236,7 @@ function compareCarriers(projectDir, globalDir, sourceDir) {
|
|
|
6238
6236
|
}
|
|
6239
6237
|
if (!inP && inG) {
|
|
6240
6238
|
out.globalOnly.push(rule);
|
|
6241
|
-
if (sourceDir !== void 0 && _ruleType(
|
|
6239
|
+
if (sourceDir !== void 0 && _ruleType(path16.join(sourceDir, rule)) === "manual") {
|
|
6242
6240
|
out.manualOnlyGlobal.push(rule);
|
|
6243
6241
|
}
|
|
6244
6242
|
continue;
|
|
@@ -6248,8 +6246,8 @@ function compareCarriers(projectDir, globalDir, sourceDir) {
|
|
|
6248
6246
|
let projectCopy;
|
|
6249
6247
|
let globalCopy;
|
|
6250
6248
|
try {
|
|
6251
|
-
projectCopy = fs18.readFileSync(
|
|
6252
|
-
globalCopy = fs18.readFileSync(
|
|
6249
|
+
projectCopy = fs18.readFileSync(path16.join(projectDir, rule));
|
|
6250
|
+
globalCopy = fs18.readFileSync(path16.join(globalDir, rule));
|
|
6253
6251
|
verdict = comparePair(projectCopy, globalCopy);
|
|
6254
6252
|
} catch {
|
|
6255
6253
|
out.shared -= 1;
|
|
@@ -6396,9 +6394,9 @@ function render2(d) {
|
|
|
6396
6394
|
}
|
|
6397
6395
|
function main9(argv) {
|
|
6398
6396
|
const args = argv ?? process2.argv.slice(2);
|
|
6399
|
-
let projectDir =
|
|
6400
|
-
let globalDir =
|
|
6401
|
-
let sourceDir =
|
|
6397
|
+
let projectDir = path16.join(REPO_ROOT2, PROJECT_RULES);
|
|
6398
|
+
let globalDir = path16.join(os3.homedir(), GLOBAL_RULES);
|
|
6399
|
+
let sourceDir = path16.join(REPO_ROOT2, PROJECTION_SOURCE);
|
|
6402
6400
|
const value = (i) => {
|
|
6403
6401
|
const v = args[i + 1];
|
|
6404
6402
|
return v === void 0 || v.startsWith("-") ? null : v;
|
|
@@ -6412,7 +6410,7 @@ function main9(argv) {
|
|
|
6412
6410
|
`);
|
|
6413
6411
|
return 1;
|
|
6414
6412
|
}
|
|
6415
|
-
const resolved =
|
|
6413
|
+
const resolved = path16.resolve(v);
|
|
6416
6414
|
if (a === "--project") projectDir = resolved;
|
|
6417
6415
|
else if (a === "--global") globalDir = resolved;
|
|
6418
6416
|
else sourceDir = resolved;
|
|
@@ -6434,9 +6432,9 @@ function main9(argv) {
|
|
|
6434
6432
|
}
|
|
6435
6433
|
function _isCliEntry9() {
|
|
6436
6434
|
if (process2.argv[1] === void 0) return false;
|
|
6437
|
-
if (import.meta.url === pathToFileURL9(
|
|
6435
|
+
if (import.meta.url === pathToFileURL9(path16.resolve(process2.argv[1])).href) return true;
|
|
6438
6436
|
try {
|
|
6439
|
-
return fs18.realpathSync(_HERE2) === fs18.realpathSync(
|
|
6437
|
+
return fs18.realpathSync(_HERE2) === fs18.realpathSync(path16.resolve(process2.argv[1]));
|
|
6440
6438
|
} catch {
|
|
6441
6439
|
return false;
|
|
6442
6440
|
}
|
|
@@ -6448,10 +6446,10 @@ if (_isCliEntry9()) {
|
|
|
6448
6446
|
// src/scripts/report_skill_activation.ts
|
|
6449
6447
|
import * as fs19 from "node:fs";
|
|
6450
6448
|
import * as os4 from "node:os";
|
|
6451
|
-
import * as
|
|
6449
|
+
import * as path17 from "node:path";
|
|
6452
6450
|
import { fileURLToPath as fileURLToPath10, pathToFileURL as pathToFileURL10 } from "node:url";
|
|
6453
6451
|
var _HERE3 = fileURLToPath10(import.meta.url);
|
|
6454
|
-
var REPO_ROOT3 =
|
|
6452
|
+
var REPO_ROOT3 = path17.resolve(path17.dirname(_HERE3), "..", "..");
|
|
6455
6453
|
var SKILLS_ROOT = "src/skills";
|
|
6456
6454
|
var TRIGGER_KEYS = ["triggers:", "trigger_description:", "file_pattern:", "path_prefix:"];
|
|
6457
6455
|
var DETERMINISTIC_RE = /^\s*(?:[-*]\s*)?(?:\*\*)?(MUST|NEVER|ALWAYS)\b/m;
|
|
@@ -6469,7 +6467,7 @@ function censusSkills(root) {
|
|
|
6469
6467
|
if (!entry.isDirectory()) {
|
|
6470
6468
|
continue;
|
|
6471
6469
|
}
|
|
6472
|
-
const file =
|
|
6470
|
+
const file = path17.join(root, entry.name, "SKILL.md");
|
|
6473
6471
|
if (!fs19.existsSync(file)) {
|
|
6474
6472
|
continue;
|
|
6475
6473
|
}
|
|
@@ -6480,7 +6478,7 @@ function censusSkills(root) {
|
|
|
6480
6478
|
if (TRIGGER_KEYS.some((k) => new RegExp(`^${k}`, "m").test(fm))) {
|
|
6481
6479
|
out.withTriggerKey.push(entry.name);
|
|
6482
6480
|
}
|
|
6483
|
-
if (fs19.existsSync(
|
|
6481
|
+
if (fs19.existsSync(path17.join(root, entry.name, "evals", "triggers.json"))) {
|
|
6484
6482
|
out.withTriggerCorpus.push(entry.name);
|
|
6485
6483
|
}
|
|
6486
6484
|
const body = fmEnd === -1 ? text : text.slice(fmEnd + 4);
|
|
@@ -6491,14 +6489,14 @@ function censusSkills(root) {
|
|
|
6491
6489
|
return out;
|
|
6492
6490
|
}
|
|
6493
6491
|
function defaultStore2(cwd) {
|
|
6494
|
-
return
|
|
6492
|
+
return path17.join(os4.homedir(), ".claude", "projects", projectStoreSlug(cwd));
|
|
6495
6493
|
}
|
|
6496
6494
|
function measureUsage(store, limit) {
|
|
6497
6495
|
const rep = { store, sessions: 0, assistantTurns: 0, invocations: 0, bySkill: {} };
|
|
6498
6496
|
if (!fs19.existsSync(store)) {
|
|
6499
6497
|
return rep;
|
|
6500
6498
|
}
|
|
6501
|
-
const files = fs19.readdirSync(store).filter((f) => f.endsWith(".jsonl")).map((f) =>
|
|
6499
|
+
const files = fs19.readdirSync(store).filter((f) => f.endsWith(".jsonl")).map((f) => path17.join(store, f)).sort((a, b) => fs19.statSync(b).mtimeMs - fs19.statSync(a).mtimeMs).slice(0, limit);
|
|
6502
6500
|
rep.sessions = files.length;
|
|
6503
6501
|
for (const file of files) {
|
|
6504
6502
|
for (const line of fs19.readFileSync(file, "utf8").split("\n")) {
|
|
@@ -6574,11 +6572,11 @@ function buildRecord(census, usage, today) {
|
|
|
6574
6572
|
assistant_turns: usage.reduce((a, u) => a + u.assistantTurns, 0),
|
|
6575
6573
|
invocations: usage.reduce((a, u) => a + u.invocations, 0),
|
|
6576
6574
|
distinct_skills_invoked: distinct.size,
|
|
6577
|
-
stores: usage.map((u) =>
|
|
6575
|
+
stores: usage.map((u) => path17.basename(u.store))
|
|
6578
6576
|
};
|
|
6579
6577
|
}
|
|
6580
6578
|
function readRecord(repoRoot) {
|
|
6581
|
-
const file =
|
|
6579
|
+
const file = path17.join(repoRoot, RECORD_PATH);
|
|
6582
6580
|
if (!fs19.existsSync(file)) {
|
|
6583
6581
|
return null;
|
|
6584
6582
|
}
|
|
@@ -6617,7 +6615,7 @@ function render3(census, usage, published = null) {
|
|
|
6617
6615
|
}
|
|
6618
6616
|
totalInv += u.invocations;
|
|
6619
6617
|
lines.push(
|
|
6620
|
-
` ${
|
|
6618
|
+
` ${path17.basename(u.store).slice(-38).padEnd(38)} sessions=${String(u.sessions).padStart(3)} asst=${String(u.assistantTurns).padStart(6)} Skill calls=${String(u.invocations).padStart(3)}`
|
|
6621
6619
|
);
|
|
6622
6620
|
}
|
|
6623
6621
|
lines.push("");
|
|
@@ -6721,7 +6719,7 @@ function main10(argv) {
|
|
|
6721
6719
|
if (stores.length === 0) {
|
|
6722
6720
|
stores.push(defaultStore2(REPO_ROOT3));
|
|
6723
6721
|
}
|
|
6724
|
-
const census = censusSkills(
|
|
6722
|
+
const census = censusSkills(path17.join(root, SKILLS_ROOT));
|
|
6725
6723
|
const usage = stores.map((s) => measureUsage(s, limit));
|
|
6726
6724
|
process.stdout.write(`${render3(census, usage, readRecord(root))}
|
|
6727
6725
|
`);
|
|
@@ -6742,8 +6740,8 @@ function main10(argv) {
|
|
|
6742
6740
|
return 1;
|
|
6743
6741
|
}
|
|
6744
6742
|
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
6745
|
-
const file =
|
|
6746
|
-
fs19.mkdirSync(
|
|
6743
|
+
const file = path17.join(root, RECORD_PATH);
|
|
6744
|
+
fs19.mkdirSync(path17.dirname(file), { recursive: true });
|
|
6747
6745
|
fs19.writeFileSync(file, `${JSON.stringify(buildRecord(census, usage, today), null, 2)}
|
|
6748
6746
|
`);
|
|
6749
6747
|
process.stdout.write(`
|
|
@@ -6751,18 +6749,18 @@ wrote ${RECORD_PATH} (measured ${today})
|
|
|
6751
6749
|
`);
|
|
6752
6750
|
return 0;
|
|
6753
6751
|
}
|
|
6754
|
-
if (process.argv[1] !== void 0 && import.meta.url === pathToFileURL10(
|
|
6752
|
+
if (process.argv[1] !== void 0 && import.meta.url === pathToFileURL10(path17.resolve(process.argv[1])).href) {
|
|
6755
6753
|
process.exit(main10(process.argv.slice(2)));
|
|
6756
6754
|
}
|
|
6757
6755
|
|
|
6758
6756
|
// src/scripts/report_skill_obligation_violations.ts
|
|
6759
6757
|
import * as fs20 from "node:fs";
|
|
6760
6758
|
import * as os5 from "node:os";
|
|
6761
|
-
import * as
|
|
6759
|
+
import * as path18 from "node:path";
|
|
6762
6760
|
import process3 from "node:process";
|
|
6763
6761
|
import { fileURLToPath as fileURLToPath11, pathToFileURL as pathToFileURL11 } from "node:url";
|
|
6764
6762
|
var _HERE4 = fileURLToPath11(import.meta.url);
|
|
6765
|
-
var REPO_ROOT4 =
|
|
6763
|
+
var REPO_ROOT4 = path18.resolve(path18.dirname(_HERE4), "..", "..");
|
|
6766
6764
|
var OBLIGATION_LINE_RE = new RegExp(`${DETERMINISTIC_RE.source}.*`, "gm");
|
|
6767
6765
|
var PATH_RE = /`([A-Za-z0-9_./-]*\/[A-Za-z0-9_.-]+\.[a-z]{2,6})`/g;
|
|
6768
6766
|
var CMD_RE = /`([a-z][a-z0-9-]*(?: [a-z][a-z0-9:._-]*){1,3})`/g;
|
|
@@ -6800,7 +6798,7 @@ function _artefacts(line) {
|
|
|
6800
6798
|
return out;
|
|
6801
6799
|
}
|
|
6802
6800
|
function extractObligations(repoRoot) {
|
|
6803
|
-
const skillsRoot =
|
|
6801
|
+
const skillsRoot = path18.join(repoRoot, SKILLS_ROOT);
|
|
6804
6802
|
const census = censusSkills(skillsRoot);
|
|
6805
6803
|
const out = {
|
|
6806
6804
|
skills: census.withDeterministicObligation,
|
|
@@ -6814,7 +6812,7 @@ function extractObligations(repoRoot) {
|
|
|
6814
6812
|
for (const skill of census.withDeterministicObligation) {
|
|
6815
6813
|
let text;
|
|
6816
6814
|
try {
|
|
6817
|
-
text = fs20.readFileSync(
|
|
6815
|
+
text = fs20.readFileSync(path18.join(skillsRoot, skill, "SKILL.md"), "utf-8");
|
|
6818
6816
|
} catch {
|
|
6819
6817
|
continue;
|
|
6820
6818
|
}
|
|
@@ -6930,7 +6928,7 @@ function scanSessionForViolations(session, lines, forbidden, parsed) {
|
|
|
6930
6928
|
return flags;
|
|
6931
6929
|
}
|
|
6932
6930
|
function defaultStore3(cwd) {
|
|
6933
|
-
return
|
|
6931
|
+
return path18.join(os5.homedir(), ".claude", "projects", projectStoreSlug(cwd));
|
|
6934
6932
|
}
|
|
6935
6933
|
function scanStore2(repoRoot, store, limit) {
|
|
6936
6934
|
const census = extractObligations(repoRoot);
|
|
@@ -6943,14 +6941,14 @@ function scanStore2(repoRoot, store, limit) {
|
|
|
6943
6941
|
};
|
|
6944
6942
|
let files;
|
|
6945
6943
|
try {
|
|
6946
|
-
files = fs20.readdirSync(store).filter((f) => f.endsWith(".jsonl")).map((f) => ({ p:
|
|
6944
|
+
files = fs20.readdirSync(store).filter((f) => f.endsWith(".jsonl")).map((f) => ({ p: path18.join(store, f), m: fs20.statSync(path18.join(store, f)).mtimeMs })).sort((a, b) => b.m - a.m).slice(0, limit).map((x) => x.p);
|
|
6947
6945
|
} catch {
|
|
6948
6946
|
return report;
|
|
6949
6947
|
}
|
|
6950
6948
|
report.sessions = files.length;
|
|
6951
6949
|
for (const file of files) {
|
|
6952
6950
|
const lines = fs20.readFileSync(file, "utf-8").split("\n");
|
|
6953
|
-
const id =
|
|
6951
|
+
const id = path18.basename(file).replace(/\.jsonl$/, "").slice(0, 8);
|
|
6954
6952
|
const entries = _parseSession(lines);
|
|
6955
6953
|
if (loadedSkillsFrom(entries).size > 0) report.sessionsWithASkill += 1;
|
|
6956
6954
|
report.flags.push(...scanSessionForViolations(id, lines, census.forbidden, entries));
|
|
@@ -7075,9 +7073,9 @@ function main11(argv) {
|
|
|
7075
7073
|
}
|
|
7076
7074
|
function _isCliEntry10() {
|
|
7077
7075
|
if (process3.argv[1] === void 0) return false;
|
|
7078
|
-
if (import.meta.url === pathToFileURL11(
|
|
7076
|
+
if (import.meta.url === pathToFileURL11(path18.resolve(process3.argv[1])).href) return true;
|
|
7079
7077
|
try {
|
|
7080
|
-
return fs20.realpathSync(_HERE4) === fs20.realpathSync(
|
|
7078
|
+
return fs20.realpathSync(_HERE4) === fs20.realpathSync(path18.resolve(process3.argv[1]));
|
|
7081
7079
|
} catch {
|
|
7082
7080
|
return false;
|
|
7083
7081
|
}
|
|
@@ -7088,18 +7086,18 @@ if (_isCliEntry10()) {
|
|
|
7088
7086
|
|
|
7089
7087
|
// src/scripts/report_conformance_funnel.ts
|
|
7090
7088
|
var _HERE5 = fileURLToPath12(import.meta.url);
|
|
7091
|
-
var REPO_ROOT5 =
|
|
7089
|
+
var REPO_ROOT5 = path19.resolve(path19.dirname(_HERE5), "..", "..");
|
|
7092
7090
|
function buildFunnel(opts = {}) {
|
|
7093
7091
|
const repoRoot = opts.repoRoot ?? REPO_ROOT5;
|
|
7094
|
-
const projectRulesDir = opts.projectRulesDir ??
|
|
7095
|
-
const globalRulesDir = opts.globalRulesDir ??
|
|
7096
|
-
const sourceDir = opts.sourceDir ??
|
|
7092
|
+
const projectRulesDir = opts.projectRulesDir ?? path19.join(repoRoot, PROJECT_RULES);
|
|
7093
|
+
const globalRulesDir = opts.globalRulesDir ?? path19.join(os6.homedir(), GLOBAL_RULES);
|
|
7094
|
+
const sourceDir = opts.sourceDir ?? path19.join(repoRoot, PROJECTION_SOURCE);
|
|
7097
7095
|
const store = opts.store ?? defaultStore(repoRoot);
|
|
7098
7096
|
const limit = opts.limit ?? 30;
|
|
7099
7097
|
return {
|
|
7100
7098
|
delivered: measureDelivered(projectRulesDir, globalRulesDir),
|
|
7101
7099
|
divergence: compareCarriers(projectRulesDir, globalRulesDir, sourceDir),
|
|
7102
|
-
skills: censusSkills(
|
|
7100
|
+
skills: censusSkills(path19.join(repoRoot, SKILLS_ROOT)),
|
|
7103
7101
|
usage: measureUsage(store, limit),
|
|
7104
7102
|
storePresent: fs21.existsSync(store),
|
|
7105
7103
|
sk2: scanStore2(repoRoot, store, limit)
|
|
@@ -7242,7 +7240,7 @@ function main12(argv) {
|
|
|
7242
7240
|
`);
|
|
7243
7241
|
return 1;
|
|
7244
7242
|
}
|
|
7245
|
-
const resolved =
|
|
7243
|
+
const resolved = path19.resolve(v);
|
|
7246
7244
|
if (a === "--store") opts.store = resolved;
|
|
7247
7245
|
else if (a === "--project") opts.projectRulesDir = resolved;
|
|
7248
7246
|
else if (a === "--global") opts.globalRulesDir = resolved;
|
|
@@ -7274,9 +7272,9 @@ function main12(argv) {
|
|
|
7274
7272
|
}
|
|
7275
7273
|
function _isCliEntry11() {
|
|
7276
7274
|
if (process4.argv[1] === void 0) return false;
|
|
7277
|
-
if (import.meta.url === pathToFileURL12(
|
|
7275
|
+
if (import.meta.url === pathToFileURL12(path19.resolve(process4.argv[1])).href) return true;
|
|
7278
7276
|
try {
|
|
7279
|
-
return fs21.realpathSync(_HERE5) === fs21.realpathSync(
|
|
7277
|
+
return fs21.realpathSync(_HERE5) === fs21.realpathSync(path19.resolve(process4.argv[1]));
|
|
7280
7278
|
} catch {
|
|
7281
7279
|
return false;
|
|
7282
7280
|
}
|
|
@@ -7313,7 +7311,7 @@ function conformanceLogPath() {
|
|
|
7313
7311
|
if (override && override.trim().length > 0) {
|
|
7314
7312
|
return override;
|
|
7315
7313
|
}
|
|
7316
|
-
return
|
|
7314
|
+
return path20.join(os7.homedir(), ".event4u", "agent-config", "conformance-log.jsonl");
|
|
7317
7315
|
}
|
|
7318
7316
|
function installLogPath() {
|
|
7319
7317
|
const override = process5.env["AGENT_CONFIG_INSTALL_LOG"];
|
|
@@ -7360,10 +7358,10 @@ function _check_txlog_clean(logPath = installLogPath(), projectRoot = null) {
|
|
|
7360
7358
|
};
|
|
7361
7359
|
}
|
|
7362
7360
|
function routeTargetPaths(target) {
|
|
7363
|
-
return routeTargetPathsPosix(target).map((rel2) =>
|
|
7361
|
+
return routeTargetPathsPosix(target).map((rel2) => path20.join(...rel2.split("/")));
|
|
7364
7362
|
}
|
|
7365
7363
|
function _check_router_pointers(packageRoot = PACKAGE_ROOT) {
|
|
7366
|
-
const routerPath =
|
|
7364
|
+
const routerPath = path20.join(packageRoot, "dist", "router.json");
|
|
7367
7365
|
if (!fs22.existsSync(routerPath)) {
|
|
7368
7366
|
return {
|
|
7369
7367
|
id: "router-pointers",
|
|
@@ -7383,13 +7381,13 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT) {
|
|
|
7383
7381
|
remedy: "reinstall the package \u2014 dist/router.json is corrupt"
|
|
7384
7382
|
};
|
|
7385
7383
|
}
|
|
7386
|
-
const rulesDir =
|
|
7384
|
+
const rulesDir = path20.join(packageRoot, "dist", "agent-src", "rules");
|
|
7387
7385
|
const broken = [];
|
|
7388
7386
|
let ids = 0;
|
|
7389
7387
|
let targets = 0;
|
|
7390
7388
|
for (const kernelId of router["kernel"] ?? []) {
|
|
7391
7389
|
ids += 1;
|
|
7392
|
-
if (!fs22.existsSync(
|
|
7390
|
+
if (!fs22.existsSync(path20.join(rulesDir, `${kernelId}.md`))) {
|
|
7393
7391
|
broken.push(`kernel:${kernelId} \u2192 rules/${kernelId}.md missing`);
|
|
7394
7392
|
}
|
|
7395
7393
|
}
|
|
@@ -7397,7 +7395,7 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT) {
|
|
|
7397
7395
|
for (const entry of router[tier] ?? []) {
|
|
7398
7396
|
const ruleId = String(entry["id"] ?? "");
|
|
7399
7397
|
ids += 1;
|
|
7400
|
-
if (!fs22.existsSync(
|
|
7398
|
+
if (!fs22.existsSync(path20.join(rulesDir, `${ruleId}.md`))) {
|
|
7401
7399
|
broken.push(`${tier}:${ruleId} \u2192 rules/${ruleId}.md missing`);
|
|
7402
7400
|
}
|
|
7403
7401
|
for (const target of entry["routes_to"] ?? []) {
|
|
@@ -7407,7 +7405,7 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT) {
|
|
|
7407
7405
|
broken.push(`${ruleId} \u2192 unparseable routes_to ${JSON.stringify(target)}`);
|
|
7408
7406
|
continue;
|
|
7409
7407
|
}
|
|
7410
|
-
if (!candidates.some((rel2) => fs22.existsSync(
|
|
7408
|
+
if (!candidates.some((rel2) => fs22.existsSync(path20.join(packageRoot, rel2)))) {
|
|
7411
7409
|
broken.push(`${ruleId} \u2192 ${target} (${candidates[0]} missing)`);
|
|
7412
7410
|
}
|
|
7413
7411
|
}
|
|
@@ -7439,8 +7437,8 @@ function detectSmokePlatform(projectRoot) {
|
|
|
7439
7437
|
return "claude";
|
|
7440
7438
|
}
|
|
7441
7439
|
function dispatcherRunner(packageRoot) {
|
|
7442
|
-
const localTsx =
|
|
7443
|
-
const script =
|
|
7440
|
+
const localTsx = path20.join(packageRoot, "node_modules", ".bin", "tsx");
|
|
7441
|
+
const script = path20.join(packageRoot, "src", "scripts", "hooks", "dispatch_hook.ts");
|
|
7444
7442
|
if (fs22.existsSync(localTsx)) {
|
|
7445
7443
|
return [localTsx, script];
|
|
7446
7444
|
}
|
|
@@ -7491,7 +7489,7 @@ function _check_hook_dispatcher(projectRoot, packageRoot = PACKAGE_ROOT, opts =
|
|
|
7491
7489
|
};
|
|
7492
7490
|
}
|
|
7493
7491
|
function readSettingsMode(projectRoot) {
|
|
7494
|
-
const settingsPath =
|
|
7492
|
+
const settingsPath = path20.join(projectRoot, ".agent-settings.yml");
|
|
7495
7493
|
if (!fs22.existsSync(settingsPath)) {
|
|
7496
7494
|
return "eager-all";
|
|
7497
7495
|
}
|
|
@@ -7507,7 +7505,7 @@ function readSettingsMode(projectRoot) {
|
|
|
7507
7505
|
function kernelIdsFromRouter(packageRoot) {
|
|
7508
7506
|
try {
|
|
7509
7507
|
const router = JSON.parse(
|
|
7510
|
-
fs22.readFileSync(
|
|
7508
|
+
fs22.readFileSync(path20.join(packageRoot, "dist", "router.json"), "utf8")
|
|
7511
7509
|
);
|
|
7512
7510
|
return new Set((router["kernel"] ?? []).map(String));
|
|
7513
7511
|
} catch {
|
|
@@ -7524,7 +7522,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT, project
|
|
|
7524
7522
|
remedy: "set lean_projection.mode to 'eager-all' or 'thin' in .agent-settings.yml"
|
|
7525
7523
|
};
|
|
7526
7524
|
}
|
|
7527
|
-
const rulesDir = projectedRulesDir ??
|
|
7525
|
+
const rulesDir = projectedRulesDir ?? path20.join(projectRoot, ".augment", "rules");
|
|
7528
7526
|
if (!fs22.existsSync(rulesDir)) {
|
|
7529
7527
|
return {
|
|
7530
7528
|
id: "lean-projection",
|
|
@@ -7548,7 +7546,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT, project
|
|
|
7548
7546
|
for (const f of nonKernel) {
|
|
7549
7547
|
let text = "";
|
|
7550
7548
|
try {
|
|
7551
|
-
text = fs22.readFileSync(
|
|
7549
|
+
text = fs22.readFileSync(path20.join(rulesDir, f), "utf8");
|
|
7552
7550
|
} catch {
|
|
7553
7551
|
continue;
|
|
7554
7552
|
}
|
|
@@ -7579,7 +7577,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT, project
|
|
|
7579
7577
|
function _check_host_manifest(projectRoot) {
|
|
7580
7578
|
const detected = Object.entries(detectToolPresence(projectRoot)).filter(([, v]) => v === true).map(([k]) => k);
|
|
7581
7579
|
const detectedNote = detected.length > 0 ? `detected surfaces: ${detected.join(", ")}` : "no surfaces detected";
|
|
7582
|
-
const settingsPath =
|
|
7580
|
+
const settingsPath = path20.join(projectRoot, ".agent-settings.yml");
|
|
7583
7581
|
if (!fs22.existsSync(settingsPath)) {
|
|
7584
7582
|
return {
|
|
7585
7583
|
id: "host-manifest",
|
|
@@ -7764,13 +7762,13 @@ function _isCliEntry12() {
|
|
|
7764
7762
|
if (process5.argv[1] === void 0) {
|
|
7765
7763
|
return false;
|
|
7766
7764
|
}
|
|
7767
|
-
const argvUrl = pathToFileURL13(
|
|
7765
|
+
const argvUrl = pathToFileURL13(path20.resolve(process5.argv[1])).href;
|
|
7768
7766
|
if (import.meta.url === argvUrl) {
|
|
7769
7767
|
return true;
|
|
7770
7768
|
}
|
|
7771
7769
|
try {
|
|
7772
7770
|
const here = fs22.realpathSync(fileURLToPath13(import.meta.url));
|
|
7773
|
-
const argv = fs22.realpathSync(
|
|
7771
|
+
const argv = fs22.realpathSync(path20.resolve(process5.argv[1]));
|
|
7774
7772
|
return here === argv;
|
|
7775
7773
|
} catch {
|
|
7776
7774
|
return false;
|