@event4u/agent-config 14.18.0 → 14.20.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/CHANGELOG.md +120 -129
- package/README.md +71 -149
- package/dist/agent-src/README.md +1 -1
- package/dist/agent-src/commands/agent-handoff.md +44 -43
- package/dist/agent-src/commands/review/changes.md +19 -19
- package/dist/agent-src/commands/review.md +2 -2
- package/dist/agent-src/contexts/execution/host-capability-manifest.md +37 -4
- package/dist/agent-src/rules/autonomous-execution.md +1 -1
- package/dist/agent-src/rules/git-history-discipline.md +2 -2
- package/dist/agent-src/rules/guidelines.md +1 -1
- package/dist/agent-src/rules/session-canary.md +2 -2
- package/dist/agent-src/rules/token-efficiency.md +1 -1
- package/dist/agent-src/rules/untrusted-input-defense.md +0 -2
- package/dist/agent-src/skills/adversarial-review/SKILL.md +0 -8
- package/dist/agent-src/skills/canvas-design/SKILL.md +1 -1
- package/dist/agent-src/skills/design-intelligence/SKILL.md +1 -1
- package/dist/agent-src/skills/design-intelligence/data/app-interface.csv +1 -1
- package/dist/agent-src/skills/design-intelligence/data/motion.csv +17 -17
- package/dist/agent-src/skills/design-intelligence/data/ux-guidelines.csv +2 -2
- package/dist/agent-src/skills/design-intelligence/references/context-and-registers.md +17 -0
- package/dist/agent-src/skills/design-intelligence/references/design-rules-checklist.md +4 -4
- package/dist/agent-src/skills/design-review/SKILL.md +1 -1
- package/dist/agent-src/skills/design-variations/SKILL.md +1 -1
- package/dist/agent-src/skills/evaluate-llm-feature/SKILL.md +1 -1
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +1 -1
- package/dist/agent-src/skills/fe-design/SKILL.md +32 -5
- package/dist/agent-src/skills/fe-design/references/craft-floor.md +7 -0
- package/dist/agent-src/skills/fe-design/references/design-patterns.md +47 -2
- package/dist/agent-src/skills/laravel-scheduling/SKILL.md +3 -1
- package/dist/agent-src/skills/markitdown/SKILL.md +1 -1
- package/dist/agent-src/skills/project-analyzer/SKILL.md +0 -6
- package/dist/agent-src/skills/react-native-setup/SKILL.md +3 -3
- package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +1 -1
- package/dist/agent-src/skills/sequential-thinking/SKILL.md +18 -8
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +28 -6
- package/dist/agent-src/skills/tailwind-engineer/SKILL.md +1 -1
- package/dist/agent-src/skills/test-driven-development/SKILL.md +1 -3
- package/dist/agent-src/skills/ui-apply-generic/SKILL.md +1 -1
- package/dist/agent-src/skills/ui-component-architect/SKILL.md +1 -1
- package/dist/agent-src/skills/using-git-worktrees/SKILL.md +17 -2
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/roadmaps.md +14 -1
- package/dist/agent-src/templates/scripts/telemetry/mcp_lite.ts +213 -0
- package/dist/agent-src/templates/scripts/telemetry/report_renderer.ts +16 -0
- package/dist/agent-src/templates/scripts/telemetry_report.ts +22 -2
- package/dist/cli/commands/recordTriggerEval.js +2 -2
- package/dist/cli/main.js +1 -1
- package/dist/cli/mcp/dispatch.js +10 -0
- package/dist/cli/mcp/stdio.js +33 -2
- package/dist/cli/mcp/telemetry.js +227 -0
- package/dist/cli-delegate/{chunk-AKJGUQNO.js → chunk-C6IPZRDA.js} +484 -353
- package/dist/cli-delegate/{chunk-CYH5SP6M.js → chunk-I6RHFQEG.js} +151 -16
- package/dist/cli-delegate/{chunk-7RXIKF62.js → chunk-NUMQHLS5.js} +304 -136
- package/dist/cli-delegate/{chunk-PMEKGDED.js → chunk-PI2GU3DP.js} +163 -1
- package/dist/cli-delegate/{chunk-7PRE6ZV2.js → chunk-YS6XTLEK.js} +199 -4
- package/dist/cli-delegate/chunk-ZVBOHSVF.js +1109 -0
- package/dist/cli-delegate/cmd_adr_effective.js +318 -81
- package/dist/cli-delegate/cmd_conformance.js +489 -121
- package/dist/cli-delegate/cmd_doctor.js +2 -2
- package/dist/cli-delegate/cmd_export.js +2 -2
- package/dist/cli-delegate/cmd_handoff.js +42 -12
- 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 +2 -2
- package/dist/cli-delegate/cmd_session_recycle.js +59 -902
- package/dist/cli-delegate/cmd_settings_migrate.js +2 -2
- package/dist/cli-delegate/cmd_sync.js +2 -2
- package/dist/cli-delegate/cmd_uninstall.js +2 -2
- package/dist/cli-delegate/cmd_validate.js +2 -2
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +34 -33
- 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/dispatch.js +4455 -3025
- package/dist/install/install.mjs +975 -689
- package/dist/mcp/registry-manifest.json +2 -2
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +2087 -1134
- package/dist/scripts/_lib/model_tier.js +1 -1
- package/dist/scripts/mcp_server/telemetry.js +148 -0
- package/docs/guidelines/agent-infra/evaluator-independence-mechanics.md +1 -1
- package/docs/guidelines/agent-infra/naming.md +1 -1
- package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
- package/docs/guidelines/agent-infra/security-lint-containment.md +46 -6
- package/docs/guidelines/agent-infra/self-improvement-pipeline.md +4 -4
- package/docs/guidelines/agent-infra/untrusted-input-spotlighting.md +1 -1
- package/docs/guidelines/design-antipatterns.md +87 -64
- package/docs/guidelines/redundancy-taxonomy.md +28 -0
- package/package.json +1 -1
- package/src/agent-src/README.md +1 -1
- package/src/agent-src/templates/scripts/telemetry/mcp_lite.ts +213 -0
- package/src/agent-src/templates/scripts/telemetry/report_renderer.ts +16 -0
- package/src/agent-src/templates/scripts/telemetry_report.ts +22 -2
- package/src/config/assurance-capability-registry.json +9 -0
- package/src/config/ci-local-parity.yml +6 -0
- package/src/config/gate-coverage.yml +225 -0
- package/src/config/gate-violation-baselines.json +18 -6
- package/src/config/release-gate-locality.yml +12 -0
- package/src/scripts/_cli/cmd_doctor.ts +2 -2
- package/src/scripts/_cli/cmd_handoff.ts +1 -1
- package/src/scripts/_cli/cmd_session_recycle.ts +51 -3
- package/src/scripts/_cli/cmd_update.ts +1 -1
- package/src/scripts/_cli/cmd_versions.ts +1 -1
- package/src/scripts/_lib/adr_frontmatter.ts +44 -0
- package/src/scripts/_lib/audit_field_provenance.ts +44 -3
- package/src/scripts/_lib/consequence_objects.ts +152 -0
- package/src/scripts/_lib/exec_evidence.ts +7 -0
- package/src/scripts/_lib/global_deploy_inventory.ts +2 -2
- package/src/scripts/_lib/host_capability.ts +38 -0
- package/src/scripts/_lib/host_permission_checks.ts +251 -0
- package/src/scripts/_lib/install_reach_checks.ts +33 -1
- package/src/scripts/_lib/mcp_bridge.ts +222 -10
- package/src/scripts/_lib/mcp_consent_residual.ts +173 -0
- package/src/scripts/_lib/model_tier.ts +1 -1
- package/src/scripts/_lib/obligation_frequency.ts +2 -2
- package/src/scripts/_lib/orchestration_record.ts +23 -1
- package/src/scripts/_lib/recycle_envelope_paths.ts +190 -0
- package/src/scripts/_lib/release_highlights.ts +93 -0
- package/src/scripts/_lib/release_material.ts +64 -1
- package/src/scripts/_lib/release_position.ts +96 -0
- package/src/scripts/_lib/review_skipped_record.ts +17 -1
- package/src/scripts/_lib/runtime_journal.ts +26 -3
- package/src/scripts/_lib/runtime_wiring_checks.ts +12 -1
- package/src/scripts/_lib/security_lint.ts +179 -7
- package/src/scripts/_lib/self_repair.ts +141 -6
- package/src/scripts/_lib/self_repair_store.ts +273 -7
- package/src/scripts/_lib/session_register.ts +11 -6
- package/src/scripts/_lib/sqlite_schema.ts +22 -0
- package/src/scripts/_lib/subagent_capsule.ts +155 -3
- package/src/scripts/_lib/surface.ts +86 -0
- package/src/scripts/_lib/ui_authority.ts +116 -0
- package/src/scripts/adr/regenerate_index.ts +54 -1
- package/src/scripts/adr_cite_check.ts +71 -15
- package/src/scripts/ai_council/clients.ts +1 -1
- package/src/scripts/autonomy_friction_corpus.ts +229 -0
- package/src/scripts/build_proof.ts +15 -2
- package/src/scripts/build_rule_trigger_matrix.ts +5 -0
- package/src/scripts/check_beta_review_markers.ts +141 -17
- package/src/scripts/check_enforcement_coverage.ts +1 -1
- package/src/scripts/check_enforcement_denominator.ts +121 -11
- package/src/scripts/check_finding_dispositions.ts +66 -9
- package/src/scripts/check_gate_coverage.ts +96 -0
- package/src/scripts/check_mcp_doc_drift.ts +217 -0
- package/src/scripts/check_pack_size.ts +321 -3
- package/src/scripts/check_release_highlights.ts +74 -1
- package/src/scripts/check_skill_activation_claim.ts +179 -0
- package/src/scripts/check_trigger_evals.ts +1 -1
- package/src/scripts/conformance_scan.ts +44 -3
- package/src/scripts/explain_run.ts +1 -1
- package/src/scripts/generate_capability_matrix.ts +1 -1
- package/src/scripts/git_authorization_hook.ts +75 -1
- package/src/scripts/handoff_context_hook.ts +54 -7
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +14 -11
- package/src/scripts/hooks/augment-dispatcher.sh +1 -1
- package/src/scripts/hooks/category_a.ts +291 -0
- package/src/scripts/hooks/cline-dispatcher.sh +1 -1
- package/src/scripts/hooks/cursor-dispatcher.sh +11 -5
- package/src/scripts/hooks/dispatch_hook.ts +17 -22
- package/src/scripts/hooks/git_command_classifier.ts +156 -1
- package/src/scripts/hooks/host_lowering.ts +215 -0
- package/src/scripts/hooks/host_lowering.yaml +185 -0
- package/src/scripts/hooks/host_semantics.ts +105 -37
- package/src/scripts/hooks/journal_record_hook.ts +10 -0
- package/src/scripts/hooks/permission_gate.ts +117 -0
- package/src/scripts/hooks/session_eol_hook.ts +18 -7
- package/src/scripts/hooks_status.ts +12 -10
- package/src/scripts/install.ts +57 -86
- package/src/scripts/install_anthropic_key.sh +2 -2
- package/src/scripts/lint_agent_security.ts +316 -25
- package/src/scripts/lint_confusables.ts +42 -6
- package/src/scripts/lint_design_antipattern_parity.ts +80 -0
- package/src/scripts/lint_evidence_artifacts.ts +45 -1
- package/src/scripts/lint_handoffs.ts +0 -132
- package/src/scripts/lint_hidden_unicode.ts +49 -7
- package/src/scripts/lint_hook_manifest.ts +87 -3
- package/src/scripts/lint_instruction_smuggling.ts +42 -6
- package/src/scripts/lint_mcp_config_security.ts +42 -6
- package/src/scripts/lint_motion_authority_drift.ts +731 -0
- package/src/scripts/lint_readme_size.ts +158 -12
- package/src/scripts/lint_reasoning_fixtures.ts +216 -0
- package/src/scripts/lint_roadmap_later_disposition.ts +217 -27
- package/src/scripts/lint_skill_frontmatter_safety.ts +43 -7
- package/src/scripts/lint_skill_trigger_contradiction.ts +161 -0
- package/src/scripts/mcp_server/resources.ts +41 -0
- package/src/scripts/mcp_server/telemetry.ts +19 -4
- package/src/scripts/measure_sibling_naming.ts +150 -0
- package/src/scripts/orchestration_record.ts +12 -1
- package/src/scripts/redact_hook_capture.ts +1 -1
- package/src/scripts/release.ts +24 -24
- package/src/scripts/release_publication.ts +6 -2
- package/src/scripts/report_skill_activation.ts +319 -7
- package/src/scripts/schemas/review-findings.schema.json +5 -0
- package/src/scripts/schemas/skill.schema.json +2 -2
- package/src/scripts/self_repair_cli.ts +31 -1
- package/src/scripts/session_canary_hook.ts +1 -1
- package/src/scripts/session_register_hook.ts +4 -3
- package/src/scripts/skill_scout.ts +69 -0
- package/src/scripts/trigger_eval_grandfather.json +5 -1
- package/src/scripts/validate_agent_settings.ts +1 -1
- package/dist/cli-delegate/chunk-2GNWGMAL.js +0 -172
- package/dist/cli-delegate/chunk-LPPWO5CE.js +0 -161
|
@@ -2,20 +2,21 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
|
|
|
2
2
|
import {
|
|
3
3
|
deriveSessionKey,
|
|
4
4
|
foldRefusal,
|
|
5
|
-
parseRecord,
|
|
6
|
-
readInstallBoundary,
|
|
7
|
-
sessionRefusalFile
|
|
8
|
-
} from "./chunk-2GNWGMAL.js";
|
|
9
|
-
import {
|
|
10
5
|
isCiPoll,
|
|
11
6
|
isVacuousOutput,
|
|
7
|
+
parseRecord,
|
|
12
8
|
pendingCount,
|
|
9
|
+
readInstallBoundary,
|
|
10
|
+
sessionRefusalFile,
|
|
13
11
|
statePathFor,
|
|
14
12
|
validateAssumption
|
|
15
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YS6XTLEK.js";
|
|
16
14
|
import {
|
|
17
15
|
readHookStdin
|
|
18
16
|
} from "./chunk-F7DQWYR5.js";
|
|
17
|
+
import {
|
|
18
|
+
reportScanned
|
|
19
|
+
} from "./chunk-I3EIN2YG.js";
|
|
19
20
|
import {
|
|
20
21
|
ArgparseExit,
|
|
21
22
|
STATUS_SYMBOLS,
|
|
@@ -33,7 +34,7 @@ import {
|
|
|
33
34
|
frontmatterPaths,
|
|
34
35
|
proseEqual,
|
|
35
36
|
splitFrontmatter
|
|
36
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-NUMQHLS5.js";
|
|
37
38
|
import "./chunk-FTAISGDQ.js";
|
|
38
39
|
import "./chunk-M2DPGFZ4.js";
|
|
39
40
|
import "./chunk-BTWUYDGN.js";
|
|
@@ -57,8 +58,9 @@ import {
|
|
|
57
58
|
import {
|
|
58
59
|
atomicAppendLine,
|
|
59
60
|
manifest_path,
|
|
61
|
+
probeHostCapabilities,
|
|
60
62
|
read_manifest
|
|
61
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-PI2GU3DP.js";
|
|
62
64
|
import "./chunk-MWRD5YOH.js";
|
|
63
65
|
import "./chunk-T7L2QK3K.js";
|
|
64
66
|
import "./chunk-DMSZHXZS.js";
|
|
@@ -81,7 +83,7 @@ var YAML = __toESM(require_dist(), 1);
|
|
|
81
83
|
import * as fs13 from "node:fs";
|
|
82
84
|
import * as os7 from "node:os";
|
|
83
85
|
import * as path13 from "node:path";
|
|
84
|
-
import
|
|
86
|
+
import process5 from "node:process";
|
|
85
87
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
86
88
|
import { fileURLToPath as fileURLToPath13, pathToFileURL as pathToFileURL13 } from "node:url";
|
|
87
89
|
|
|
@@ -147,7 +149,7 @@ function routeTargetPathsPosix(target) {
|
|
|
147
149
|
import * as fs12 from "node:fs";
|
|
148
150
|
import * as os6 from "node:os";
|
|
149
151
|
import * as path12 from "node:path";
|
|
150
|
-
import
|
|
152
|
+
import process4 from "node:process";
|
|
151
153
|
import { fileURLToPath as fileURLToPath12, pathToFileURL as pathToFileURL12 } from "node:url";
|
|
152
154
|
|
|
153
155
|
// src/scripts/conformance_scan.ts
|
|
@@ -739,6 +741,128 @@ function humanTypedThisTurn(prompt) {
|
|
|
739
741
|
return true;
|
|
740
742
|
}
|
|
741
743
|
|
|
744
|
+
// src/scripts/_lib/consequence_objects.ts
|
|
745
|
+
var CONSEQUENCE_PHRASES = [
|
|
746
|
+
{
|
|
747
|
+
op: "prod-deploy",
|
|
748
|
+
re: /(?<![A-Za-z0-9_À-ɏ])(deploy(e|en|t|st)?|ausroll(e|en)?|ship(pe|pen)?|live\s*schalt(e|en)?|rollout)\b[^.\n]{0,30}\b(produktion|production|prod|live|prod-umgebung)\b|\b(produktion|production|prod|live)\b[^.\n]{0,30}\b(deploy(e|en)?|ausrollen|ausroll(e|en)?|live\s*schalten|rollout)\b/i
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
op: "prod-data-destroy",
|
|
752
|
+
re: /(?<![A-Za-z0-9_À-ɏ])(l(ö|oe)sch(e|en)?|entfern(e|en)?|leer(e|en)?|verwerf(e|en)?|drop|truncate|delete|wipe|purge|zerst(ö|oe)r(e|en)?)\b[^.\n]{0,40}\b(tabelle|tabellen|datenbank|daten|bucket|collection|zeilen|rows|table|database|dataset)\b|\b(tabelle|tabellen|datenbank|daten|bucket|collection|table|database)\b[^.\n]{0,40}\b(l(ö|oe)schen|leeren|verwerfen|droppen|truncaten|entfernen|drop|truncate|delete|wipe|purge)\b/i
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
op: "prod-infra-change",
|
|
756
|
+
re: /(?<![A-Za-z0-9_À-ɏ])((ver)?(ä|ae)nder(e|n)?|anpass(e|en)?|umbau(e|en)?|apply|destroy|(neu\s*)?provisionier(e|en)?)\b[^.\n]{0,40}\b(infrastruktur|infrastructure|cluster|terraform|iam|dns|netzwerk|network|firewall|policy|policies|security[-\s]group)\b|\b(infrastruktur|infrastructure|cluster|terraform|iam|dns|netzwerk|firewall)\b[^.\n]{0,40}\b((ver)?(ä|ae)ndern|anpassen|umbauen|zerst(ö|oe)ren|apply|destroy)\b/i
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
op: "external-send",
|
|
760
|
+
re: /(?<![A-Za-z0-9_À-ɏ])(schick(e|en)?|verschick(e|en)?|send(e|en|et)?|mail(e|en)?|raussend(e|en)?|versend(e|en)?|post|publish)\b[^.\n]{0,40}\b(mail|mails|email|e-mail|nachricht|nachrichten|newsletter|webhook|kunden|kundin|kunde|empf(ä|ae)nger|customers?|recipients?|message)\b|\b(mail|email|e-mail|nachricht|newsletter|kunden|customers?)\b[^.\n]{0,40}\b(schicken|verschicken|senden|versenden|rausschicken|send|deliver)\b/i
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
op: "money-movement",
|
|
764
|
+
re: /(?<![A-Za-z0-9_À-ɏ])(erstatt(e|en)?|r(ü|ue)ckerstatt(e|en)?|zahl(e|en)?|(ü|ue)berweis(e|en)?|abbuch(e|en)?|belast(e|en)?|refund|charge|payout|transfer|bill)\b[^.\n]{0,40}\b(betrag|geld|rechnung|zahlung|euro|dollar|kunde|kunden|karte|konto|invoice|payment|customer|card|account)\b|\b(betrag|geld|rechnung|zahlung|invoice|payment)\b[^.\n]{0,40}\b(erstatten|zur(ü|ue)ckzahlen|(ü|ue)berweisen|abbuchen|belasten|refund|charge|transfer)\b/i
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
op: "trunk-force-push",
|
|
768
|
+
re: /(?<![A-Za-z0-9_À-ɏ])(force[-\s]?push(e|en|t)?|force[-\s]?pushen|(ü|ue)berschreib(e|en)?)\b[^.\n]{0,40}\b(main|master|trunk|produktions?[-\s]?branch|production|release[-\s]?branch)\b|\b(main|master|trunk|production)\b[^.\n]{0,40}\b(force[-\s]?pushen|force[-\s]?push|(ü|ue)berschreiben)\b/i
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
op: "out-of-scope-destruction",
|
|
772
|
+
re: /(?<![A-Za-z0-9_À-ɏ])(l(ö|oe)sch(e|en)?|entfern(e|en)?|r(ä|ae)um(e|en)?\s*auf|aufr(ä|ae)um(e|en)?|delete|remove|wipe)\b[^.\n]{0,40}\b(au(ß|ss)erhalb|ausserhalb|unabh(ä|ae)ngig|nicht\s+zur\s+aufgabe|outside\s+(the\s+)?(task|scope)|unrelated|everything\s+else|alles\s+andere)\b|\b(au(ß|ss)erhalb|outside\s+(the\s+)?(task|scope)|unrelated)\b[^.\n]{0,40}\b(l(ö|oe)schen|entfernen|aufr(ä|ae)umen|delete|remove|wipe)\b/i
|
|
773
|
+
}
|
|
774
|
+
];
|
|
775
|
+
var OBJECT_REQUIRED_OPS = /* @__PURE__ */ new Set([
|
|
776
|
+
"prod-data-destroy",
|
|
777
|
+
"external-send",
|
|
778
|
+
"money-movement"
|
|
779
|
+
]);
|
|
780
|
+
var OBJECT_STOP_WORDS = /* @__PURE__ */ new Set([
|
|
781
|
+
"bitte",
|
|
782
|
+
"doch",
|
|
783
|
+
"mal",
|
|
784
|
+
"nicht",
|
|
785
|
+
"jetzt",
|
|
786
|
+
"gleich",
|
|
787
|
+
"auch",
|
|
788
|
+
"noch",
|
|
789
|
+
"wieder",
|
|
790
|
+
"in",
|
|
791
|
+
"im",
|
|
792
|
+
"aus",
|
|
793
|
+
"von",
|
|
794
|
+
"vom",
|
|
795
|
+
": ",
|
|
796
|
+
"der",
|
|
797
|
+
"die",
|
|
798
|
+
"das",
|
|
799
|
+
"den",
|
|
800
|
+
"dem",
|
|
801
|
+
"und",
|
|
802
|
+
"oder",
|
|
803
|
+
"mit",
|
|
804
|
+
"auf",
|
|
805
|
+
"zu",
|
|
806
|
+
"komplett",
|
|
807
|
+
"ganz",
|
|
808
|
+
"alle",
|
|
809
|
+
"allen",
|
|
810
|
+
"please",
|
|
811
|
+
"now",
|
|
812
|
+
"again",
|
|
813
|
+
"too",
|
|
814
|
+
"also",
|
|
815
|
+
"from",
|
|
816
|
+
"and",
|
|
817
|
+
"or",
|
|
818
|
+
"the",
|
|
819
|
+
"a",
|
|
820
|
+
"an",
|
|
821
|
+
"there",
|
|
822
|
+
"here",
|
|
823
|
+
"completely",
|
|
824
|
+
"all",
|
|
825
|
+
"with",
|
|
826
|
+
"on",
|
|
827
|
+
"to",
|
|
828
|
+
"in"
|
|
829
|
+
]);
|
|
830
|
+
function _normalizeObject(raw) {
|
|
831
|
+
return raw.trim().replace(/^["'`]+|["'`]+$/g, "").replace(/[.,;:]+$/, "").toLowerCase();
|
|
832
|
+
}
|
|
833
|
+
var OBJECT_PATTERNS = {
|
|
834
|
+
"prod-data-destroy": [
|
|
835
|
+
/\b(?:tabelle|table|datenbank|database|schema|collection|index)\s+["'`]?([A-Za-z_][\w.$-]*)/gi,
|
|
836
|
+
/\bs3:\/\/([\w.-]+)/gi,
|
|
837
|
+
/\b(?:bucket)\s+["'`]?([A-Za-z_][\w.-]*)/gi
|
|
838
|
+
],
|
|
839
|
+
"external-send": [
|
|
840
|
+
/([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,})/g,
|
|
841
|
+
/\bhttps?:\/\/([^\s/"'`]+)/gi,
|
|
842
|
+
/\b(?:an\s+(?:die|den|alle)|to\s+(?:the|all))\s+([A-Za-z][\w-]*)/gi
|
|
843
|
+
],
|
|
844
|
+
"money-movement": [
|
|
845
|
+
/(\d[\d.,]*)\s*(?:€|eur\b|euro\b|\$|usd\b)/gi,
|
|
846
|
+
/(?:€|\$)\s*(\d[\d.,]*)/g,
|
|
847
|
+
/\b(?:kunde|kunden|customer|account|konto)\s+["'`]?([A-Za-z0-9][\w.-]*)/gi
|
|
848
|
+
]
|
|
849
|
+
};
|
|
850
|
+
function extractObjects(op, text) {
|
|
851
|
+
const patterns = OBJECT_PATTERNS[op];
|
|
852
|
+
if (!patterns) return [];
|
|
853
|
+
const out = [];
|
|
854
|
+
for (const re of patterns) {
|
|
855
|
+
const local = new RegExp(re.source, re.flags.includes("g") ? re.flags : `${re.flags}g`);
|
|
856
|
+
let m;
|
|
857
|
+
while ((m = local.exec(text)) !== null) {
|
|
858
|
+
const value = _normalizeObject(m[1] ?? "");
|
|
859
|
+
if (value && !OBJECT_STOP_WORDS.has(value) && !out.includes(value)) out.push(value);
|
|
860
|
+
if (m.index === local.lastIndex) local.lastIndex++;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return out;
|
|
864
|
+
}
|
|
865
|
+
|
|
742
866
|
// src/scripts/git_authorization_hook.ts
|
|
743
867
|
var EXIT_ALLOW2 = 0;
|
|
744
868
|
var STATE_FILE2 = path2.join("agents", "state", "git-authorization.json");
|
|
@@ -790,7 +914,14 @@ var ALL_OPS = [
|
|
|
790
914
|
"clean",
|
|
791
915
|
"stash-drop",
|
|
792
916
|
"branch-delete",
|
|
793
|
-
"close"
|
|
917
|
+
"close",
|
|
918
|
+
"prod-deploy",
|
|
919
|
+
"prod-data-destroy",
|
|
920
|
+
"prod-infra-change",
|
|
921
|
+
"external-send",
|
|
922
|
+
"money-movement",
|
|
923
|
+
"trunk-force-push",
|
|
924
|
+
"out-of-scope-destruction"
|
|
794
925
|
];
|
|
795
926
|
var PHRASES = [
|
|
796
927
|
{ op: "commit", re: /\b(commit(e|et|te|ten)?|committe|einchecken)\b/i },
|
|
@@ -948,7 +1079,8 @@ var PHRASES = [
|
|
|
948
1079
|
{
|
|
949
1080
|
op: "pr-merge-auto",
|
|
950
1081
|
re: /\bauto[-\s]?merge\b|\bmerge\b[^.\n]{0,20}\bautomatisch\b|\bautomatisch\b[^.\n]{0,20}\bmerg(e|en)\b/i
|
|
951
|
-
}
|
|
1082
|
+
},
|
|
1083
|
+
...CONSEQUENCE_PHRASES
|
|
952
1084
|
];
|
|
953
1085
|
var OUTPUT_LINE = /^\s*(To\s+\S+|remote:|error:|fatal:|hint:|warning:|!\s|\?\?\s|\s*\^|[-+]{3}\s|@@\s|\$\s|>\s|\d+\s+(pass|fail)|npm ERR!|Error:|Traceback|at\s+\S+:\d+)/i;
|
|
954
1086
|
function isInterrogative(prose) {
|
|
@@ -1317,6 +1449,11 @@ function run2(stdin_text, options) {
|
|
|
1317
1449
|
authorized.push(pending.op);
|
|
1318
1450
|
evidence[pending.op] = `confirmation of the refused \`${pending.op}\` (refused ${pending.refused_at}): "${prompt.trim().slice(0, 40)}"`;
|
|
1319
1451
|
}
|
|
1452
|
+
const objects = {};
|
|
1453
|
+
for (const op of authorized) {
|
|
1454
|
+
const named = extractObjects(op, prompt);
|
|
1455
|
+
if (named.length > 0) objects[op] = named;
|
|
1456
|
+
}
|
|
1320
1457
|
const now = /* @__PURE__ */ new Date();
|
|
1321
1458
|
const ledger = {
|
|
1322
1459
|
session_id: typeof envelope["session_id"] === "string" ? envelope["session_id"] : "",
|
|
@@ -1324,6 +1461,7 @@ function run2(stdin_text, options) {
|
|
|
1324
1461
|
authorized,
|
|
1325
1462
|
evidence,
|
|
1326
1463
|
prompt_chars: prompt.length,
|
|
1464
|
+
objects,
|
|
1327
1465
|
// Grants survive this write; `authorized` does not. That asymmetry IS the
|
|
1328
1466
|
// decision. A bare operation name stays one-shot exactly as `commit-policy`
|
|
1329
1467
|
// requires, and only an authorization that also froze its objects earns a
|
|
@@ -1415,10 +1553,26 @@ var BLOCK_OPS = /* @__PURE__ */ new Set([
|
|
|
1415
1553
|
/** Destroys uncommitted work belonging to a session this one cannot see. */
|
|
1416
1554
|
"worktree-remove",
|
|
1417
1555
|
/** `-x` is the flag that takes `.env` and local certificates. */
|
|
1418
|
-
"clean-ignored"
|
|
1556
|
+
"clean-ignored",
|
|
1557
|
+
// ── The consequence vocabulary, added 2026-09-06. Every one is already
|
|
1558
|
+
// never-autonomous in the `non-destructive-by-default` prose.
|
|
1559
|
+
//
|
|
1560
|
+
// MEMBERSHIP HERE IS A COUNTING DECISION, NOT A REFUSAL. The set's name
|
|
1561
|
+
// predates ADR-254, which deleted the reader that blocked: the one consumer
|
|
1562
|
+
// that acts on it now is `conformance_scan`'s after-the-fact tally, so
|
|
1563
|
+
// "blocked" describes what the Hard Floor requires of the model, never what
|
|
1564
|
+
// this package does at tool-call time.
|
|
1565
|
+
"prod-deploy",
|
|
1566
|
+
"prod-data-destroy",
|
|
1567
|
+
"prod-infra-change",
|
|
1568
|
+
"external-send",
|
|
1569
|
+
"money-movement",
|
|
1570
|
+
"trunk-force-push",
|
|
1571
|
+
"out-of-scope-destruction"
|
|
1419
1572
|
]);
|
|
1420
1573
|
var G = "(?:-[A-Za-z-]+(?:=\\S+)?(?:\\s+\\S+)?\\s+)*";
|
|
1421
1574
|
var P = "^(?:\\S*\\/)?";
|
|
1575
|
+
var CONSEQUENCE_TOOL_HEAD = /^(?:\S*\/)?(terraform|pulumi|kubectl|helm|aws|gcloud|az|vercel|netlify|flyctl|fly|wrangler|serverless|sls|eb|heroku|cap|psql|mysql|mariadb|sqlite3|mongosh|mongo|redis-cli|sendmail|msmtp|mail|mailx|curl|stripe|braintree|paypal|rm)\b/i;
|
|
1422
1576
|
function ghApiWrite(pathRe) {
|
|
1423
1577
|
return new RegExp(
|
|
1424
1578
|
`${P}gh\\s+api\\b(?=[^\\n]*${pathRe})(?=[^\\n]*(?:-X|--method)\\s+(?:POST|PATCH|PUT|DELETE)\\b)`,
|
|
@@ -1499,6 +1653,13 @@ var COMMAND_OPS = [
|
|
|
1499
1653
|
// Above `push`, and both spellings: `--force` and `--force-with-lease`. The
|
|
1500
1654
|
// "safe force" is in the same class here because what it is safe against is a
|
|
1501
1655
|
// stale local view, not a collaborator who pushed after your fetch.
|
|
1656
|
+
{
|
|
1657
|
+
op: "trunk-force-push",
|
|
1658
|
+
re: new RegExp(
|
|
1659
|
+
`${P}git\\s+${G}push\\b[^\\n;|&]*(--force\\b|--force-with-lease\\b|\\s-f\\b)[^\\n;|&]*\\b(main|master|trunk|production|prod)\\b`,
|
|
1660
|
+
"i"
|
|
1661
|
+
)
|
|
1662
|
+
},
|
|
1502
1663
|
{
|
|
1503
1664
|
op: "force-push",
|
|
1504
1665
|
re: new RegExp(`${P}git\\s+${G}push\\b[^\\n;|&]*(--force\\b|--force-with-lease\\b|\\s-f\\b)`, "i")
|
|
@@ -1527,6 +1688,60 @@ var COMMAND_OPS = [
|
|
|
1527
1688
|
)
|
|
1528
1689
|
},
|
|
1529
1690
|
{ op: "close", re: new RegExp(`${P}gh\\s+(pr|issue)\\s+close\\b`, "i") },
|
|
1691
|
+
// ── Consequence operations, added 2026-09-06
|
|
1692
|
+
// (`road-to-authorization-that-reaches-further` 2.1).
|
|
1693
|
+
//
|
|
1694
|
+
// ORDER: above the generic `push`/`commit` fallbacks, because
|
|
1695
|
+
// `trunk-force-push` is a `git push` and the most specific pattern must win —
|
|
1696
|
+
// the rule this table states at its head.
|
|
1697
|
+
//
|
|
1698
|
+
// These classify commands the count could not see before. They add NOTHING to
|
|
1699
|
+
// any refusal path: `commandOp` and `BLOCK_OPS` have exactly one consumer
|
|
1700
|
+
// that acts on them, the after-the-fact tally in `conformance_scan`, and this
|
|
1701
|
+
// change does not add a second.
|
|
1702
|
+
{
|
|
1703
|
+
op: "prod-data-destroy",
|
|
1704
|
+
re: new RegExp(
|
|
1705
|
+
`${P}(psql|mysql|mariadb|sqlite3|mongosh?)\\b[^\\n]*\\b(drop\\s+(table|database|schema)|truncate|delete\\s+from)\\b|${P}aws\\s+s3\\s+(rm|rb)\\b|${P}aws\\s+(dynamodb|rds)\\s+delete-\\S+|${P}redis-cli\\b[^\\n]*\\bflush(all|db)\\b`,
|
|
1706
|
+
"i"
|
|
1707
|
+
)
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
op: "prod-infra-change",
|
|
1711
|
+
re: new RegExp(
|
|
1712
|
+
`${P}terraform\\s+(apply|destroy)\\b|${P}pulumi\\s+(up|destroy)\\b|${P}kubectl\\s+(apply|delete|scale|drain)\\b|${P}helm\\s+(install|upgrade|uninstall|rollback)\\b|${P}aws\\s+(iam|ec2|route53|elbv2)\\s+(create|delete|put|update|modify|attach|detach)-\\S+|${P}(gcloud|az)\\s+\\S+\\s+(create|delete|update)\\b`,
|
|
1713
|
+
"i"
|
|
1714
|
+
)
|
|
1715
|
+
},
|
|
1716
|
+
{
|
|
1717
|
+
op: "prod-deploy",
|
|
1718
|
+
re: new RegExp(
|
|
1719
|
+
`${P}(vercel|netlify|flyctl|fly|wrangler|serverless|sls|eb|heroku)\\s+${G}deploy\\b|${P}(vercel|netlify)\\b[^\\n]*--prod\\b|${P}(npm|pnpm|yarn)\\s+run\\s+deploy\\b|${P}cap\\s+production\\s+deploy\\b`,
|
|
1720
|
+
"i"
|
|
1721
|
+
)
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
op: "external-send",
|
|
1725
|
+
re: new RegExp(
|
|
1726
|
+
`${P}(sendmail|msmtp|mailx?)\\b|${P}curl\\b(?=[^\\n]*(?:-X|--request)\\s+(?:POST|PUT|PATCH)\\b)(?=[^\\n]*https?:\\/\\/)`,
|
|
1727
|
+
"i"
|
|
1728
|
+
)
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
op: "money-movement",
|
|
1732
|
+
re: new RegExp(
|
|
1733
|
+
`${P}(stripe|braintree|paypal)\\s+\\S*(charge|refund|payout|transfer|payment)\\S*\\b`,
|
|
1734
|
+
"i"
|
|
1735
|
+
)
|
|
1736
|
+
},
|
|
1737
|
+
{
|
|
1738
|
+
// `rm -rf` on an ABSOLUTE path or a home-relative one. Deliberately not
|
|
1739
|
+
// "outside the working tree" — this function receives a command string and
|
|
1740
|
+
// no cwd, so that reading is not decidable here and a classifier that
|
|
1741
|
+
// guesses is worse than one that under-reports.
|
|
1742
|
+
op: "out-of-scope-destruction",
|
|
1743
|
+
re: new RegExp(`${P}rm\\s+(-\\S+\\s+)*-\\S*[rR]\\S*\\s+(-\\S+\\s+)*(~|/)\\S*`, "i")
|
|
1744
|
+
},
|
|
1530
1745
|
{ op: "push", re: new RegExp(`${P}git\\s+${G}push\\b`, "i") },
|
|
1531
1746
|
{ op: "commit", re: new RegExp(`${P}git\\s+${G}commit\\b`, "i") },
|
|
1532
1747
|
{ op: "branch", re: new RegExp(`${P}git\\s+${G}(checkout\\s+-b|switch\\s+-c)\\b`, "i") }
|
|
@@ -1677,7 +1892,7 @@ function invokedSegments(command, depth = 0) {
|
|
|
1677
1892
|
function commandOp(command) {
|
|
1678
1893
|
let found = null;
|
|
1679
1894
|
for (const seg of invokedSegments(command)) {
|
|
1680
|
-
if (!/^(?:\S*\/)?(git|gh|npm|pnpm|yarn)\b/.test(seg)) {
|
|
1895
|
+
if (!/^(?:\S*\/)?(git|gh|npm|pnpm|yarn)\b/.test(seg) && !CONSEQUENCE_TOOL_HEAD.test(seg)) {
|
|
1681
1896
|
continue;
|
|
1682
1897
|
}
|
|
1683
1898
|
for (const { op, re } of COMMAND_OPS) {
|
|
@@ -1692,6 +1907,37 @@ function commandOp(command) {
|
|
|
1692
1907
|
}
|
|
1693
1908
|
return found;
|
|
1694
1909
|
}
|
|
1910
|
+
function commandObject(op, command) {
|
|
1911
|
+
const patterns = COMMAND_OBJECTS[op];
|
|
1912
|
+
if (!patterns) return null;
|
|
1913
|
+
for (const re of patterns) {
|
|
1914
|
+
const m = new RegExp(re.source, re.flags.replace("g", "")).exec(command);
|
|
1915
|
+
const raw = m?.[1];
|
|
1916
|
+
if (raw) {
|
|
1917
|
+
const value = raw.trim().replace(/^["'`]+|["'`]+$/g, "").replace(/[.,;:]+$/, "").toLowerCase();
|
|
1918
|
+
if (value) return value;
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
return null;
|
|
1922
|
+
}
|
|
1923
|
+
var COMMAND_OBJECTS = {
|
|
1924
|
+
"prod-data-destroy": [
|
|
1925
|
+
/\bdrop\s+(?:table|database|schema|collection)\s+(?:if\s+exists\s+)?["'`]?([\w.$-]+)/i,
|
|
1926
|
+
/\btruncate\s+(?:table\s+)?["'`]?([\w.$-]+)/i,
|
|
1927
|
+
/\bdelete\s+from\s+["'`]?([\w.$-]+)/i,
|
|
1928
|
+
/\bs3:\/\/([\w.-]+)/i,
|
|
1929
|
+
/--table-name[= ]["'`]?([\w.-]+)/i
|
|
1930
|
+
],
|
|
1931
|
+
"external-send": [
|
|
1932
|
+
/\bhttps?:\/\/([^\s/"'`]+)/i,
|
|
1933
|
+
/([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,})/
|
|
1934
|
+
],
|
|
1935
|
+
"money-movement": [
|
|
1936
|
+
/--customer[= ]["'`]?([\w.-]+)/i,
|
|
1937
|
+
/--amount[= ]["'`]?([\d.,]+)/i,
|
|
1938
|
+
/\b(\d[\d.,]*)\s*(?:eur|usd)\b/i
|
|
1939
|
+
]
|
|
1940
|
+
};
|
|
1695
1941
|
|
|
1696
1942
|
// src/scripts/hooks/turn_end_gate_hook.ts
|
|
1697
1943
|
import * as fs5 from "node:fs";
|
|
@@ -1706,6 +1952,19 @@ import * as os from "node:os";
|
|
|
1706
1952
|
import * as path3 from "node:path";
|
|
1707
1953
|
import { fileURLToPath as fileURLToPath3, pathToFileURL as pathToFileURL3 } from "node:url";
|
|
1708
1954
|
|
|
1955
|
+
// src/scripts/_lib/audit_field_provenance.ts
|
|
1956
|
+
var MAX_APPLIED_IDS = 32;
|
|
1957
|
+
function appliedIds(values) {
|
|
1958
|
+
const out = [];
|
|
1959
|
+
for (const raw of values ?? []) {
|
|
1960
|
+
const v = String(raw).trim();
|
|
1961
|
+
if (v === "" || out.includes(v)) continue;
|
|
1962
|
+
out.push(v);
|
|
1963
|
+
if (out.length >= MAX_APPLIED_IDS) break;
|
|
1964
|
+
}
|
|
1965
|
+
return out;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1709
1968
|
// src/scripts/_lib/review_skipped_record.ts
|
|
1710
1969
|
var PRODUCER_PRIVACY_CLASS = "ids-only";
|
|
1711
1970
|
function isNonNegInt(n) {
|
|
@@ -1734,7 +1993,8 @@ function buildReviewSkippedLine(input) {
|
|
|
1734
1993
|
risk_class: input.diff_lines >= HIGH_RISK_DIFF_LINES ? "high" : "medium",
|
|
1735
1994
|
memory: { asks: 0, hits: 0 },
|
|
1736
1995
|
verify: { claims: 0, first_try_passes: 0 },
|
|
1737
|
-
|
|
1996
|
+
// COMPUTED, never a producer constant.
|
|
1997
|
+
rules_applied: appliedIds(input.rules_applied),
|
|
1738
1998
|
// MANDATORY on every audit line, same as the orchestration producer.
|
|
1739
1999
|
privacy_class: PRODUCER_PRIVACY_CLASS,
|
|
1740
2000
|
// `skills_applied` is OMITTED here, deliberately and not by oversight.
|
|
@@ -3204,55 +3464,6 @@ import fs7 from "node:fs";
|
|
|
3204
3464
|
import path7 from "node:path";
|
|
3205
3465
|
import { fileURLToPath as fileURLToPath7, pathToFileURL as pathToFileURL7 } from "node:url";
|
|
3206
3466
|
|
|
3207
|
-
// src/scripts/_lib/host_capability.ts
|
|
3208
|
-
import process2 from "node:process";
|
|
3209
|
-
var SAFE_DEFAULT = {
|
|
3210
|
-
schema_version: 1,
|
|
3211
|
-
subagent_spawn: false,
|
|
3212
|
-
parallel_spawn: false,
|
|
3213
|
-
status_polling: false,
|
|
3214
|
-
separate_quota_pool: false,
|
|
3215
|
-
agent_teams: false,
|
|
3216
|
-
worker_respawn: false
|
|
3217
|
-
};
|
|
3218
|
-
function asBool(value) {
|
|
3219
|
-
return value === true;
|
|
3220
|
-
}
|
|
3221
|
-
function normalizeHostManifest(input) {
|
|
3222
|
-
if (input === null || typeof input !== "object") {
|
|
3223
|
-
return { ...SAFE_DEFAULT };
|
|
3224
|
-
}
|
|
3225
|
-
const src = input;
|
|
3226
|
-
return {
|
|
3227
|
-
schema_version: 1,
|
|
3228
|
-
subagent_spawn: asBool(src.subagent_spawn),
|
|
3229
|
-
parallel_spawn: asBool(src.parallel_spawn),
|
|
3230
|
-
status_polling: asBool(src.status_polling),
|
|
3231
|
-
separate_quota_pool: asBool(src.separate_quota_pool),
|
|
3232
|
-
agent_teams: asBool(src.agent_teams),
|
|
3233
|
-
worker_respawn: asBool(src.worker_respawn)
|
|
3234
|
-
};
|
|
3235
|
-
}
|
|
3236
|
-
var HOST_CAPABILITY_REGISTRY = {
|
|
3237
|
-
claude: { subagent_spawn: true, parallel_spawn: true }
|
|
3238
|
-
};
|
|
3239
|
-
function resolveHostCapabilities(hostId, override) {
|
|
3240
|
-
if (override !== void 0 && override !== null && typeof override === "object" && !Array.isArray(override)) {
|
|
3241
|
-
return normalizeHostManifest(override);
|
|
3242
|
-
}
|
|
3243
|
-
const row = hostId !== null && hostId !== void 0 ? HOST_CAPABILITY_REGISTRY[hostId] : void 0;
|
|
3244
|
-
if (row === void 0) {
|
|
3245
|
-
return { ...SAFE_DEFAULT };
|
|
3246
|
-
}
|
|
3247
|
-
return { ...SAFE_DEFAULT, ...row, schema_version: 1 };
|
|
3248
|
-
}
|
|
3249
|
-
function probeHostCapabilities(hostId) {
|
|
3250
|
-
const base = resolveHostCapabilities(hostId);
|
|
3251
|
-
const flag = process2.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS;
|
|
3252
|
-
const probedAgentTeams = typeof flag === "string" && flag !== "";
|
|
3253
|
-
return { ...base, agent_teams: base.agent_teams || probedAgentTeams };
|
|
3254
|
-
}
|
|
3255
|
-
|
|
3256
3467
|
// src/scripts/_lib/auto_dispatch.ts
|
|
3257
3468
|
var SIZE_FLOOR = 1;
|
|
3258
3469
|
function inSession(reason) {
|
|
@@ -3914,6 +4125,7 @@ function scanSession(sessionId, lines) {
|
|
|
3914
4125
|
let pinned = null;
|
|
3915
4126
|
let pendingPoll = null;
|
|
3916
4127
|
let authorized = /* @__PURE__ */ new Set();
|
|
4128
|
+
let authorizedObjects = /* @__PURE__ */ new Map();
|
|
3917
4129
|
let sawPending = false;
|
|
3918
4130
|
let evaluationsThisTurn = 0;
|
|
3919
4131
|
let turnsSincePrompt = 0;
|
|
@@ -4007,7 +4219,11 @@ function scanSession(sessionId, lines) {
|
|
|
4007
4219
|
if (c.language !== "und") {
|
|
4008
4220
|
pinned = c.language;
|
|
4009
4221
|
}
|
|
4010
|
-
|
|
4222
|
+
const classified = classifyAuthorization(ut);
|
|
4223
|
+
authorized = new Set(classified.authorized);
|
|
4224
|
+
authorizedObjects = new Map(
|
|
4225
|
+
classified.authorized.map((op) => [op, new Set(extractObjects(op, ut))])
|
|
4226
|
+
);
|
|
4011
4227
|
sawPending = false;
|
|
4012
4228
|
evaluationsThisTurn = 0;
|
|
4013
4229
|
pendingPoll = null;
|
|
@@ -4073,6 +4289,17 @@ function scanSession(sessionId, lines) {
|
|
|
4073
4289
|
at,
|
|
4074
4290
|
detail: `irreversible \`${op}\` with no authorization in the turn's prompt: ${cmd.slice(0, 110)}`
|
|
4075
4291
|
});
|
|
4292
|
+
} else if (op !== null && authorized.has(op) && OBJECT_REQUIRED_OPS.has(op)) {
|
|
4293
|
+
const object = commandObject(op, cmd);
|
|
4294
|
+
const named = authorizedObjects.get(op);
|
|
4295
|
+
if (object !== null && !(named?.has(object) ?? false)) {
|
|
4296
|
+
report.violations.push({
|
|
4297
|
+
check: "git-authorization",
|
|
4298
|
+
session: sessionId,
|
|
4299
|
+
at,
|
|
4300
|
+
detail: `\`${op}\` authorized, but its object \`${object}\` is not one the turn's prompt named (${named && named.size > 0 ? [...named].join(", ") : "no object named"}): ` + cmd.slice(0, 110)
|
|
4301
|
+
});
|
|
4302
|
+
}
|
|
4076
4303
|
}
|
|
4077
4304
|
if (isCiPoll(cmd)) {
|
|
4078
4305
|
pendingPoll = { at, cmd };
|
|
@@ -4405,7 +4632,7 @@ if (_isCliEntry8()) {
|
|
|
4405
4632
|
import * as fs9 from "node:fs";
|
|
4406
4633
|
import * as os3 from "node:os";
|
|
4407
4634
|
import * as path9 from "node:path";
|
|
4408
|
-
import
|
|
4635
|
+
import process2 from "node:process";
|
|
4409
4636
|
import { fileURLToPath as fileURLToPath9, pathToFileURL as pathToFileURL9 } from "node:url";
|
|
4410
4637
|
var _HERE = fileURLToPath9(import.meta.url);
|
|
4411
4638
|
var REPO_ROOT2 = path9.resolve(path9.dirname(_HERE), "..", "..");
|
|
@@ -4614,7 +4841,7 @@ function render2(d) {
|
|
|
4614
4841
|
return lines.join("\n");
|
|
4615
4842
|
}
|
|
4616
4843
|
function main9(argv) {
|
|
4617
|
-
const args = argv ??
|
|
4844
|
+
const args = argv ?? process2.argv.slice(2);
|
|
4618
4845
|
let projectDir = path9.join(REPO_ROOT2, PROJECT_RULES);
|
|
4619
4846
|
let globalDir = path9.join(os3.homedir(), GLOBAL_RULES);
|
|
4620
4847
|
let sourceDir = path9.join(REPO_ROOT2, PROJECTION_SOURCE);
|
|
@@ -4627,7 +4854,7 @@ function main9(argv) {
|
|
|
4627
4854
|
if (a === "--project" || a === "--global" || a === "--source") {
|
|
4628
4855
|
const v = value(i);
|
|
4629
4856
|
if (v === null) {
|
|
4630
|
-
|
|
4857
|
+
process2.stderr.write(`report_carrier_divergence: ${a} needs a directory
|
|
4631
4858
|
`);
|
|
4632
4859
|
return 1;
|
|
4633
4860
|
}
|
|
@@ -4637,31 +4864,31 @@ function main9(argv) {
|
|
|
4637
4864
|
else sourceDir = resolved;
|
|
4638
4865
|
i += 1;
|
|
4639
4866
|
} else if (a === "--help" || a === "-h") {
|
|
4640
|
-
|
|
4867
|
+
process2.stdout.write(
|
|
4641
4868
|
"usage: report_carrier_divergence [--project DIR] [--global DIR] [--source DIR]\n"
|
|
4642
4869
|
);
|
|
4643
4870
|
return 0;
|
|
4644
4871
|
} else if (a !== void 0 && a.startsWith("--") && a !== "--quiet") {
|
|
4645
|
-
|
|
4872
|
+
process2.stderr.write(`report_carrier_divergence: unknown flag ${a}
|
|
4646
4873
|
`);
|
|
4647
4874
|
return 1;
|
|
4648
4875
|
}
|
|
4649
4876
|
}
|
|
4650
|
-
|
|
4877
|
+
process2.stdout.write(`${render2(compareCarriers(projectDir, globalDir, sourceDir))}
|
|
4651
4878
|
`);
|
|
4652
4879
|
return 0;
|
|
4653
4880
|
}
|
|
4654
4881
|
function _isCliEntry9() {
|
|
4655
|
-
if (
|
|
4656
|
-
if (import.meta.url === pathToFileURL9(path9.resolve(
|
|
4882
|
+
if (process2.argv[1] === void 0) return false;
|
|
4883
|
+
if (import.meta.url === pathToFileURL9(path9.resolve(process2.argv[1])).href) return true;
|
|
4657
4884
|
try {
|
|
4658
|
-
return fs9.realpathSync(_HERE) === fs9.realpathSync(path9.resolve(
|
|
4885
|
+
return fs9.realpathSync(_HERE) === fs9.realpathSync(path9.resolve(process2.argv[1]));
|
|
4659
4886
|
} catch {
|
|
4660
4887
|
return false;
|
|
4661
4888
|
}
|
|
4662
4889
|
}
|
|
4663
4890
|
if (_isCliEntry9()) {
|
|
4664
|
-
|
|
4891
|
+
process2.exit(main9());
|
|
4665
4892
|
}
|
|
4666
4893
|
|
|
4667
4894
|
// src/scripts/report_skill_activation.ts
|
|
@@ -4675,7 +4902,12 @@ var SKILLS_ROOT = "src/skills";
|
|
|
4675
4902
|
var TRIGGER_KEYS = ["triggers:", "trigger_description:", "file_pattern:", "path_prefix:"];
|
|
4676
4903
|
var DETERMINISTIC_RE = /^\s*(?:[-*]\s*)?(?:\*\*)?(MUST|NEVER|ALWAYS)\b/m;
|
|
4677
4904
|
function censusSkills(root) {
|
|
4678
|
-
const out = {
|
|
4905
|
+
const out = {
|
|
4906
|
+
total: 0,
|
|
4907
|
+
withTriggerKey: [],
|
|
4908
|
+
withTriggerCorpus: [],
|
|
4909
|
+
withDeterministicObligation: []
|
|
4910
|
+
};
|
|
4679
4911
|
if (!fs10.existsSync(root)) {
|
|
4680
4912
|
return out;
|
|
4681
4913
|
}
|
|
@@ -4694,6 +4926,9 @@ function censusSkills(root) {
|
|
|
4694
4926
|
if (TRIGGER_KEYS.some((k) => new RegExp(`^${k}`, "m").test(fm))) {
|
|
4695
4927
|
out.withTriggerKey.push(entry.name);
|
|
4696
4928
|
}
|
|
4929
|
+
if (fs10.existsSync(path10.join(root, entry.name, "evals", "triggers.json"))) {
|
|
4930
|
+
out.withTriggerCorpus.push(entry.name);
|
|
4931
|
+
}
|
|
4697
4932
|
const body = fmEnd === -1 ? text : text.slice(fmEnd + 4);
|
|
4698
4933
|
if (DETERMINISTIC_RE.test(body)) {
|
|
4699
4934
|
out.withDeterministicObligation.push(entry.name);
|
|
@@ -4752,7 +4987,50 @@ function measureUsage(store, limit) {
|
|
|
4752
4987
|
function _pct(n, d) {
|
|
4753
4988
|
return d === 0 ? "n/a" : `${(100 * n / d).toFixed(1)}%`;
|
|
4754
4989
|
}
|
|
4755
|
-
|
|
4990
|
+
var RECORD_PATH = "agents/evidence/metrics/skill-activation-census.json";
|
|
4991
|
+
function populations(census) {
|
|
4992
|
+
const corpus = new Set(census.withTriggerCorpus);
|
|
4993
|
+
const both = census.withTriggerKey.filter((s) => corpus.has(s));
|
|
4994
|
+
const eitherOne = /* @__PURE__ */ new Set([...census.withTriggerKey, ...census.withTriggerCorpus]);
|
|
4995
|
+
return {
|
|
4996
|
+
shipped: census.total,
|
|
4997
|
+
triggerKey: census.withTriggerKey.length,
|
|
4998
|
+
triggerCorpus: census.withTriggerCorpus.length,
|
|
4999
|
+
bothKeyAndCorpus: both.length,
|
|
5000
|
+
humanNamedOnly: census.total - eitherOne.size
|
|
5001
|
+
};
|
|
5002
|
+
}
|
|
5003
|
+
function buildRecord(census, usage, today) {
|
|
5004
|
+
const pop = populations(census);
|
|
5005
|
+
const distinct = /* @__PURE__ */ new Set();
|
|
5006
|
+
for (const u of usage) {
|
|
5007
|
+
for (const k of Object.keys(u.bySkill)) {
|
|
5008
|
+
distinct.add(k);
|
|
5009
|
+
}
|
|
5010
|
+
}
|
|
5011
|
+
return {
|
|
5012
|
+
schema_version: 1,
|
|
5013
|
+
measured_at: today,
|
|
5014
|
+
skills_shipped: pop.shipped,
|
|
5015
|
+
with_trigger_key: pop.triggerKey,
|
|
5016
|
+
with_trigger_corpus: pop.triggerCorpus,
|
|
5017
|
+
trigger_key_and_corpus: pop.bothKeyAndCorpus,
|
|
5018
|
+
human_named_only: pop.humanNamedOnly,
|
|
5019
|
+
sessions: usage.reduce((a, u) => a + u.sessions, 0),
|
|
5020
|
+
assistant_turns: usage.reduce((a, u) => a + u.assistantTurns, 0),
|
|
5021
|
+
invocations: usage.reduce((a, u) => a + u.invocations, 0),
|
|
5022
|
+
distinct_skills_invoked: distinct.size,
|
|
5023
|
+
stores: usage.map((u) => path10.basename(u.store))
|
|
5024
|
+
};
|
|
5025
|
+
}
|
|
5026
|
+
function readRecord(repoRoot) {
|
|
5027
|
+
const file = path10.join(repoRoot, RECORD_PATH);
|
|
5028
|
+
if (!fs10.existsSync(file)) {
|
|
5029
|
+
return null;
|
|
5030
|
+
}
|
|
5031
|
+
return JSON.parse(fs10.readFileSync(file, "utf8"));
|
|
5032
|
+
}
|
|
5033
|
+
function render3(census, usage, published = null) {
|
|
4756
5034
|
const lines = [];
|
|
4757
5035
|
lines.push("skill activation census \u2014 advisory, gates on nothing");
|
|
4758
5036
|
lines.push("");
|
|
@@ -4767,6 +5045,16 @@ function render3(census, usage) {
|
|
|
4767
5045
|
lines.push(` ${census.withDeterministicObligation.join(", ")}`);
|
|
4768
5046
|
}
|
|
4769
5047
|
lines.push("");
|
|
5048
|
+
const pop = populations(census);
|
|
5049
|
+
lines.push(" populations \u2014 the three ways a skill can be reached, reconciled");
|
|
5050
|
+
lines.push(` machine-matchable trigger key ${pop.triggerKey}`);
|
|
5051
|
+
lines.push(` evals/triggers.json corpus ${pop.triggerCorpus} (a test fixture; no host reads it at routing time)`);
|
|
5052
|
+
lines.push(` both of the above ${pop.bothKeyAndCorpus}`);
|
|
5053
|
+
lines.push(` human-named only (remainder) ${pop.humanNamedOnly}`);
|
|
5054
|
+
lines.push(
|
|
5055
|
+
` reconciles ${pop.triggerKey} + ${pop.triggerCorpus} - ${pop.bothKeyAndCorpus} + ${pop.humanNamedOnly} = ${String(pop.triggerKey + pop.triggerCorpus - pop.bothKeyAndCorpus + pop.humanNamedOnly)} of ${pop.shipped}`
|
|
5056
|
+
);
|
|
5057
|
+
lines.push("");
|
|
4770
5058
|
let totalInv = 0;
|
|
4771
5059
|
const distinct = /* @__PURE__ */ new Set();
|
|
4772
5060
|
for (const u of usage) {
|
|
@@ -4787,6 +5075,51 @@ function render3(census, usage) {
|
|
|
4787
5075
|
lines.push(` ${[...distinct].sort().join(", ")}`);
|
|
4788
5076
|
}
|
|
4789
5077
|
lines.push("");
|
|
5078
|
+
const sessionsRead = usage.reduce((a, u) => a + u.sessions, 0);
|
|
5079
|
+
if (sessionsRead === 0) {
|
|
5080
|
+
lines.push(' EMPTY STORE: 0 sessions were read, so the zero above is "no transcripts at');
|
|
5081
|
+
lines.push(' this path", NOT "no activations". It is not a measurement of the surface and');
|
|
5082
|
+
lines.push(" must not be published as one. Run this where the store lives, or pass --store.");
|
|
5083
|
+
lines.push("");
|
|
5084
|
+
}
|
|
5085
|
+
if (published !== null) {
|
|
5086
|
+
const live = buildRecord(census, usage, published.measured_at);
|
|
5087
|
+
const REPO_FIELDS = [
|
|
5088
|
+
"skills_shipped",
|
|
5089
|
+
"with_trigger_key",
|
|
5090
|
+
"with_trigger_corpus",
|
|
5091
|
+
"trigger_key_and_corpus",
|
|
5092
|
+
"human_named_only"
|
|
5093
|
+
];
|
|
5094
|
+
const STORE_FIELDS = [
|
|
5095
|
+
"sessions",
|
|
5096
|
+
"assistant_turns",
|
|
5097
|
+
"invocations",
|
|
5098
|
+
"distinct_skills_invoked"
|
|
5099
|
+
];
|
|
5100
|
+
const repoDrift = REPO_FIELDS.filter((k) => live[k] !== published[k]);
|
|
5101
|
+
const storeDrift = STORE_FIELDS.filter((k) => live[k] !== published[k]);
|
|
5102
|
+
lines.push(` PUBLISHED RECORD (${RECORD_PATH}), measured ${published.measured_at}:`);
|
|
5103
|
+
lines.push(
|
|
5104
|
+
` sessions=${String(published.sessions)} asst=${String(published.assistant_turns)} invocations=${String(published.invocations)} distinct=${String(published.distinct_skills_invoked)}`
|
|
5105
|
+
);
|
|
5106
|
+
if (repoDrift.length > 0) {
|
|
5107
|
+
lines.push(` STALE: the published population split no longer describes this tree \u2014`);
|
|
5108
|
+
lines.push(` ${repoDrift.join(", ")} moved. Re-take with --emit.`);
|
|
5109
|
+
} else {
|
|
5110
|
+
lines.push(" population split still describes this tree.");
|
|
5111
|
+
}
|
|
5112
|
+
if (sessionsRead === 0) {
|
|
5113
|
+
lines.push(" Store reading: UNDECIDED \u2014 this run read no store, so it cannot say whether");
|
|
5114
|
+
lines.push(" the published figures still hold. Re-run where the store lives.");
|
|
5115
|
+
} else if (storeDrift.length === 0) {
|
|
5116
|
+
lines.push(" Store reading: reproduces the published figures exactly.");
|
|
5117
|
+
} else {
|
|
5118
|
+
lines.push(` Store reading: moved since the record (${storeDrift.join(", ")}). Expected \u2014`);
|
|
5119
|
+
lines.push(" the store is rolling, not append-only, and a later reading can be lower.");
|
|
5120
|
+
}
|
|
5121
|
+
lines.push("");
|
|
5122
|
+
}
|
|
4790
5123
|
if (census.withTriggerKey.length === 0) {
|
|
4791
5124
|
lines.push(" VERDICT: activation is not measurable as a rate. No skill declares a");
|
|
4792
5125
|
lines.push(" machine-matchable trigger, so a missed-activation detector has nothing to");
|
|
@@ -4800,19 +5133,30 @@ function render3(census, usage) {
|
|
|
4800
5133
|
lines.push(" catalogue once per session, then count descriptions against bare names.");
|
|
4801
5134
|
return lines.join("\n");
|
|
4802
5135
|
}
|
|
5136
|
+
var USAGE = "usage: report_skill_activation [--root DIR] [--limit N] [--store PATH]... [--emit] [--allow-empty-store]\n";
|
|
4803
5137
|
function main10(argv) {
|
|
4804
5138
|
let limit = 30;
|
|
5139
|
+
let emit = false;
|
|
5140
|
+
let allowEmpty = false;
|
|
5141
|
+
const rootIdx = argv.indexOf("--root");
|
|
5142
|
+
const root = rootIdx === -1 ? REPO_ROOT3 : argv[rootIdx + 1] ?? REPO_ROOT3;
|
|
4805
5143
|
const stores = [];
|
|
4806
5144
|
for (let i = 0; i < argv.length; i += 1) {
|
|
4807
5145
|
const a = argv[i];
|
|
4808
|
-
if (a === "--
|
|
5146
|
+
if (a === "--root" && argv[i + 1] !== void 0) {
|
|
5147
|
+
i += 1;
|
|
5148
|
+
} else if (a === "--limit" && argv[i + 1] !== void 0) {
|
|
4809
5149
|
limit = Number.parseInt(argv[i + 1], 10);
|
|
4810
5150
|
i += 1;
|
|
4811
5151
|
} else if (a === "--store" && argv[i + 1] !== void 0) {
|
|
4812
5152
|
stores.push(argv[i + 1]);
|
|
4813
5153
|
i += 1;
|
|
5154
|
+
} else if (a === "--emit") {
|
|
5155
|
+
emit = true;
|
|
5156
|
+
} else if (a === "--allow-empty-store") {
|
|
5157
|
+
allowEmpty = true;
|
|
4814
5158
|
} else if (a === "--help" || a === "-h") {
|
|
4815
|
-
process.stdout.write(
|
|
5159
|
+
process.stdout.write(USAGE);
|
|
4816
5160
|
return 0;
|
|
4817
5161
|
}
|
|
4818
5162
|
}
|
|
@@ -4823,9 +5167,33 @@ function main10(argv) {
|
|
|
4823
5167
|
if (stores.length === 0) {
|
|
4824
5168
|
stores.push(defaultStore2(REPO_ROOT3));
|
|
4825
5169
|
}
|
|
4826
|
-
const census = censusSkills(path10.join(
|
|
5170
|
+
const census = censusSkills(path10.join(root, SKILLS_ROOT));
|
|
4827
5171
|
const usage = stores.map((s) => measureUsage(s, limit));
|
|
4828
|
-
process.stdout.write(`${render3(census, usage)}
|
|
5172
|
+
process.stdout.write(`${render3(census, usage, readRecord(root))}
|
|
5173
|
+
`);
|
|
5174
|
+
reportScanned({
|
|
5175
|
+
gate: "report_skill_activation",
|
|
5176
|
+
scanned: census.total,
|
|
5177
|
+
units: "SKILL.md file(s)",
|
|
5178
|
+
roots: [SKILLS_ROOT]
|
|
5179
|
+
});
|
|
5180
|
+
if (!emit) {
|
|
5181
|
+
return 0;
|
|
5182
|
+
}
|
|
5183
|
+
const sessionsRead = usage.reduce((a, u) => a + u.sessions, 0);
|
|
5184
|
+
if (sessionsRead === 0 && !allowEmpty) {
|
|
5185
|
+
process.stderr.write(
|
|
5186
|
+
'report_skill_activation --emit: refusing to write a record from 0 sessions \u2014 that zero\nis "no transcripts at this path", not an activation reading. Run where the store lives,\npass --store, or pass --allow-empty-store if an empty store is genuinely the finding.\n'
|
|
5187
|
+
);
|
|
5188
|
+
return 1;
|
|
5189
|
+
}
|
|
5190
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
5191
|
+
const file = path10.join(root, RECORD_PATH);
|
|
5192
|
+
fs10.mkdirSync(path10.dirname(file), { recursive: true });
|
|
5193
|
+
fs10.writeFileSync(file, `${JSON.stringify(buildRecord(census, usage, today), null, 2)}
|
|
5194
|
+
`);
|
|
5195
|
+
process.stdout.write(`
|
|
5196
|
+
wrote ${RECORD_PATH} (measured ${today})
|
|
4829
5197
|
`);
|
|
4830
5198
|
return 0;
|
|
4831
5199
|
}
|
|
@@ -4837,7 +5205,7 @@ if (process.argv[1] !== void 0 && import.meta.url === pathToFileURL10(path10.res
|
|
|
4837
5205
|
import * as fs11 from "node:fs";
|
|
4838
5206
|
import * as os5 from "node:os";
|
|
4839
5207
|
import * as path11 from "node:path";
|
|
4840
|
-
import
|
|
5208
|
+
import process3 from "node:process";
|
|
4841
5209
|
import { fileURLToPath as fileURLToPath11, pathToFileURL as pathToFileURL11 } from "node:url";
|
|
4842
5210
|
var _HERE3 = fileURLToPath11(import.meta.url);
|
|
4843
5211
|
var REPO_ROOT4 = path11.resolve(path11.dirname(_HERE3), "..", "..");
|
|
@@ -5099,7 +5467,7 @@ function render4(r) {
|
|
|
5099
5467
|
return lines.join("\n");
|
|
5100
5468
|
}
|
|
5101
5469
|
function main11(argv) {
|
|
5102
|
-
const args = argv ??
|
|
5470
|
+
const args = argv ?? process3.argv.slice(2);
|
|
5103
5471
|
let limit = 30;
|
|
5104
5472
|
let json = false;
|
|
5105
5473
|
const stores = [];
|
|
@@ -5112,7 +5480,7 @@ function main11(argv) {
|
|
|
5112
5480
|
if (a === "--limit") {
|
|
5113
5481
|
const v = value(i);
|
|
5114
5482
|
if (v === null) {
|
|
5115
|
-
|
|
5483
|
+
process3.stderr.write("report_skill_obligation_violations: --limit needs a number\n");
|
|
5116
5484
|
return 1;
|
|
5117
5485
|
}
|
|
5118
5486
|
limit = Number.parseInt(v, 10);
|
|
@@ -5120,7 +5488,7 @@ function main11(argv) {
|
|
|
5120
5488
|
} else if (a === "--store") {
|
|
5121
5489
|
const v = value(i);
|
|
5122
5490
|
if (v === null) {
|
|
5123
|
-
|
|
5491
|
+
process3.stderr.write("report_skill_obligation_violations: --store needs a path\n");
|
|
5124
5492
|
return 1;
|
|
5125
5493
|
}
|
|
5126
5494
|
stores.push(v);
|
|
@@ -5128,40 +5496,40 @@ function main11(argv) {
|
|
|
5128
5496
|
} else if (a === "--json") {
|
|
5129
5497
|
json = true;
|
|
5130
5498
|
} else if (a === "--help" || a === "-h") {
|
|
5131
|
-
|
|
5499
|
+
process3.stdout.write(
|
|
5132
5500
|
"usage: report_skill_obligation_violations [--limit N] [--store PATH]... [--json]\n"
|
|
5133
5501
|
);
|
|
5134
5502
|
return 0;
|
|
5135
5503
|
} else if (a !== void 0 && a.startsWith("--") && a !== "--quiet") {
|
|
5136
|
-
|
|
5504
|
+
process3.stderr.write(`report_skill_obligation_violations: unknown flag ${a}
|
|
5137
5505
|
`);
|
|
5138
5506
|
return 1;
|
|
5139
5507
|
}
|
|
5140
5508
|
}
|
|
5141
5509
|
if (!Number.isFinite(limit) || limit <= 0) {
|
|
5142
|
-
|
|
5510
|
+
process3.stderr.write("report_skill_obligation_violations: --limit must be a positive integer\n");
|
|
5143
5511
|
return 1;
|
|
5144
5512
|
}
|
|
5145
5513
|
if (stores.length === 0) stores.push(defaultStore3(REPO_ROOT4));
|
|
5146
5514
|
for (const store of stores) {
|
|
5147
5515
|
const r = scanStore2(REPO_ROOT4, store, limit);
|
|
5148
|
-
|
|
5516
|
+
process3.stdout.write(json ? `${JSON.stringify(r, null, 2)}
|
|
5149
5517
|
` : `${render4(r)}
|
|
5150
5518
|
`);
|
|
5151
5519
|
}
|
|
5152
5520
|
return 0;
|
|
5153
5521
|
}
|
|
5154
5522
|
function _isCliEntry10() {
|
|
5155
|
-
if (
|
|
5156
|
-
if (import.meta.url === pathToFileURL11(path11.resolve(
|
|
5523
|
+
if (process3.argv[1] === void 0) return false;
|
|
5524
|
+
if (import.meta.url === pathToFileURL11(path11.resolve(process3.argv[1])).href) return true;
|
|
5157
5525
|
try {
|
|
5158
|
-
return fs11.realpathSync(_HERE3) === fs11.realpathSync(path11.resolve(
|
|
5526
|
+
return fs11.realpathSync(_HERE3) === fs11.realpathSync(path11.resolve(process3.argv[1]));
|
|
5159
5527
|
} catch {
|
|
5160
5528
|
return false;
|
|
5161
5529
|
}
|
|
5162
5530
|
}
|
|
5163
5531
|
if (_isCliEntry10()) {
|
|
5164
|
-
|
|
5532
|
+
process3.exit(main11());
|
|
5165
5533
|
}
|
|
5166
5534
|
|
|
5167
5535
|
// src/scripts/report_conformance_funnel.ts
|
|
@@ -5305,7 +5673,7 @@ function render5(r) {
|
|
|
5305
5673
|
return lines.join("\n");
|
|
5306
5674
|
}
|
|
5307
5675
|
function main12(argv) {
|
|
5308
|
-
const args = argv ??
|
|
5676
|
+
const args = argv ?? process4.argv.slice(2);
|
|
5309
5677
|
const opts = {};
|
|
5310
5678
|
const value = (i) => {
|
|
5311
5679
|
const v = args[i + 1];
|
|
@@ -5316,7 +5684,7 @@ function main12(argv) {
|
|
|
5316
5684
|
if (a === "--store" || a === "--project" || a === "--global" || a === "--source") {
|
|
5317
5685
|
const v = value(i);
|
|
5318
5686
|
if (v === null) {
|
|
5319
|
-
|
|
5687
|
+
process4.stderr.write(`report_conformance_funnel: ${a} needs a value
|
|
5320
5688
|
`);
|
|
5321
5689
|
return 1;
|
|
5322
5690
|
}
|
|
@@ -5330,37 +5698,37 @@ function main12(argv) {
|
|
|
5330
5698
|
const v = value(i);
|
|
5331
5699
|
const n = v === null ? Number.NaN : Number.parseInt(v, 10);
|
|
5332
5700
|
if (!Number.isFinite(n) || n <= 0) {
|
|
5333
|
-
|
|
5701
|
+
process4.stderr.write("report_conformance_funnel: --limit must be a positive integer\n");
|
|
5334
5702
|
return 1;
|
|
5335
5703
|
}
|
|
5336
5704
|
opts.limit = n;
|
|
5337
5705
|
i += 1;
|
|
5338
5706
|
} else if (a === "--help" || a === "-h") {
|
|
5339
|
-
|
|
5707
|
+
process4.stdout.write(
|
|
5340
5708
|
"usage: report_conformance_funnel [--store PATH] [--limit N]\n [--project DIR] [--global DIR] [--source DIR]\n"
|
|
5341
5709
|
);
|
|
5342
5710
|
return 0;
|
|
5343
5711
|
} else if (a !== void 0 && a.startsWith("--") && a !== "--quiet") {
|
|
5344
|
-
|
|
5712
|
+
process4.stderr.write(`report_conformance_funnel: unknown flag ${a}
|
|
5345
5713
|
`);
|
|
5346
5714
|
return 1;
|
|
5347
5715
|
}
|
|
5348
5716
|
}
|
|
5349
|
-
|
|
5717
|
+
process4.stdout.write(`${render5(buildFunnel(opts))}
|
|
5350
5718
|
`);
|
|
5351
5719
|
return 0;
|
|
5352
5720
|
}
|
|
5353
5721
|
function _isCliEntry11() {
|
|
5354
|
-
if (
|
|
5355
|
-
if (import.meta.url === pathToFileURL12(path12.resolve(
|
|
5722
|
+
if (process4.argv[1] === void 0) return false;
|
|
5723
|
+
if (import.meta.url === pathToFileURL12(path12.resolve(process4.argv[1])).href) return true;
|
|
5356
5724
|
try {
|
|
5357
|
-
return fs12.realpathSync(_HERE4) === fs12.realpathSync(path12.resolve(
|
|
5725
|
+
return fs12.realpathSync(_HERE4) === fs12.realpathSync(path12.resolve(process4.argv[1]));
|
|
5358
5726
|
} catch {
|
|
5359
5727
|
return false;
|
|
5360
5728
|
}
|
|
5361
5729
|
}
|
|
5362
5730
|
if (_isCliEntry11()) {
|
|
5363
|
-
|
|
5731
|
+
process4.exit(main12());
|
|
5364
5732
|
}
|
|
5365
5733
|
|
|
5366
5734
|
// src/scripts/_cli/cmd_conformance.ts
|
|
@@ -5375,22 +5743,22 @@ var CONFORMANCE_CHECK_IDS = [
|
|
|
5375
5743
|
];
|
|
5376
5744
|
var THIN_STUB_MARKER = "Routed rule \u2014 load the body on trigger-match";
|
|
5377
5745
|
function print(s = "") {
|
|
5378
|
-
|
|
5746
|
+
process5.stdout.write(`${s}
|
|
5379
5747
|
`);
|
|
5380
5748
|
}
|
|
5381
5749
|
function eprint(s = "") {
|
|
5382
|
-
|
|
5750
|
+
process5.stderr.write(`${s}
|
|
5383
5751
|
`);
|
|
5384
5752
|
}
|
|
5385
5753
|
function conformanceLogPath() {
|
|
5386
|
-
const override =
|
|
5754
|
+
const override = process5.env["AGENT_CONFIG_CONFORMANCE_LOG"];
|
|
5387
5755
|
if (override && override.trim().length > 0) {
|
|
5388
5756
|
return override;
|
|
5389
5757
|
}
|
|
5390
5758
|
return path13.join(os7.homedir(), ".event4u", "agent-config", "conformance-log.jsonl");
|
|
5391
5759
|
}
|
|
5392
5760
|
function installLogPath() {
|
|
5393
|
-
const override =
|
|
5761
|
+
const override = process5.env["AGENT_CONFIG_INSTALL_LOG"];
|
|
5394
5762
|
if (override && override.trim().length > 0) {
|
|
5395
5763
|
return override;
|
|
5396
5764
|
}
|
|
@@ -5688,7 +6056,7 @@ function _check_host_manifest(projectRoot) {
|
|
|
5688
6056
|
};
|
|
5689
6057
|
}
|
|
5690
6058
|
function runConformanceChecks(opts = {}) {
|
|
5691
|
-
const projectRoot = opts.projectRoot ??
|
|
6059
|
+
const projectRoot = opts.projectRoot ?? process5.cwd();
|
|
5692
6060
|
const packageRoot = opts.packageRoot ?? PACKAGE_ROOT;
|
|
5693
6061
|
const checks = [];
|
|
5694
6062
|
checks.push(_check_txlog_clean());
|
|
@@ -5722,14 +6090,14 @@ function appendConformanceReport(checks, projectRoot, logPath = conformanceLogPa
|
|
|
5722
6090
|
} catch {
|
|
5723
6091
|
}
|
|
5724
6092
|
}
|
|
5725
|
-
var
|
|
6093
|
+
var USAGE2 = "usage: agent-config conformance [-h] [--project PROJECT] [--json]\n [--skip-dispatcher] [--funnel]\n";
|
|
5726
6094
|
function _parse(argv) {
|
|
5727
6095
|
const opts = { project: null, json: false, skip_dispatcher: false, funnel: false };
|
|
5728
6096
|
let i = 0;
|
|
5729
6097
|
while (i < argv.length) {
|
|
5730
6098
|
const a = argv[i];
|
|
5731
6099
|
if (a === "-h" || a === "--help") {
|
|
5732
|
-
|
|
6100
|
+
process5.stdout.write(USAGE2);
|
|
5733
6101
|
throw new ArgparseExit(0);
|
|
5734
6102
|
}
|
|
5735
6103
|
if (a === "--json") {
|
|
@@ -5743,16 +6111,16 @@ function _parse(argv) {
|
|
|
5743
6111
|
opts.project = a.slice(a.indexOf("=") + 1);
|
|
5744
6112
|
} else {
|
|
5745
6113
|
if (i + 1 >= argv.length) {
|
|
5746
|
-
|
|
5747
|
-
|
|
6114
|
+
process5.stderr.write(USAGE2);
|
|
6115
|
+
process5.stderr.write("agent-config conformance: error: --project expects a value\n");
|
|
5748
6116
|
throw new ArgparseExit(2);
|
|
5749
6117
|
}
|
|
5750
6118
|
opts.project = argv[i + 1];
|
|
5751
6119
|
i += 1;
|
|
5752
6120
|
}
|
|
5753
6121
|
} else {
|
|
5754
|
-
|
|
5755
|
-
|
|
6122
|
+
process5.stderr.write(USAGE2);
|
|
6123
|
+
process5.stderr.write(`agent-config conformance: error: unrecognized argument ${a}
|
|
5756
6124
|
`);
|
|
5757
6125
|
throw new ArgparseExit(2);
|
|
5758
6126
|
}
|
|
@@ -5761,7 +6129,7 @@ function _parse(argv) {
|
|
|
5761
6129
|
return opts;
|
|
5762
6130
|
}
|
|
5763
6131
|
function main13(argv = null) {
|
|
5764
|
-
const opts = _parse(argv !== null ? Array.from(argv) :
|
|
6132
|
+
const opts = _parse(argv !== null ? Array.from(argv) : process5.argv.slice(2));
|
|
5765
6133
|
if (opts.funnel) {
|
|
5766
6134
|
print(render5(buildFunnel()));
|
|
5767
6135
|
return 0;
|
|
@@ -5832,27 +6200,27 @@ function main13(argv = null) {
|
|
|
5832
6200
|
return failed ? 1 : 0;
|
|
5833
6201
|
}
|
|
5834
6202
|
function _isCliEntry12() {
|
|
5835
|
-
if (
|
|
6203
|
+
if (process5.argv[1] === void 0) {
|
|
5836
6204
|
return false;
|
|
5837
6205
|
}
|
|
5838
|
-
const argvUrl = pathToFileURL13(path13.resolve(
|
|
6206
|
+
const argvUrl = pathToFileURL13(path13.resolve(process5.argv[1])).href;
|
|
5839
6207
|
if (import.meta.url === argvUrl) {
|
|
5840
6208
|
return true;
|
|
5841
6209
|
}
|
|
5842
6210
|
try {
|
|
5843
6211
|
const here = fs13.realpathSync(fileURLToPath13(import.meta.url));
|
|
5844
|
-
const argv = fs13.realpathSync(path13.resolve(
|
|
6212
|
+
const argv = fs13.realpathSync(path13.resolve(process5.argv[1]));
|
|
5845
6213
|
return here === argv;
|
|
5846
6214
|
} catch {
|
|
5847
6215
|
return false;
|
|
5848
6216
|
}
|
|
5849
6217
|
}
|
|
5850
|
-
if (_isCliEntry12() ||
|
|
6218
|
+
if (_isCliEntry12() || process5.argv[1] === _HERE5) {
|
|
5851
6219
|
try {
|
|
5852
|
-
|
|
6220
|
+
process5.exitCode = main13(process5.argv.slice(2));
|
|
5853
6221
|
} catch (e) {
|
|
5854
6222
|
if (e instanceof ArgparseExit) {
|
|
5855
|
-
|
|
6223
|
+
process5.exitCode = e.code;
|
|
5856
6224
|
} else {
|
|
5857
6225
|
throw e;
|
|
5858
6226
|
}
|