@event4u/agent-config 16.3.0 → 16.5.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 +178 -78
- package/README.md +2 -2
- package/agents/templates/.ai-council.yml.example +26 -8
- package/dist/agent-src/commands/analyze/inbox.md +10 -7
- package/dist/agent-src/commands/bug/investigate.md +1 -1
- package/dist/agent-src/commands/commit/in-chunks.md +40 -31
- package/dist/agent-src/commands/commit.md +72 -33
- package/dist/agent-src/commands/condense.md +2 -8
- package/dist/agent-src/commands/council/debate.md +11 -7
- package/dist/agent-src/commands/council/default.md +10 -9
- package/dist/agent-src/commands/council.md +1 -1
- package/dist/agent-src/commands/design.md +1 -1
- package/dist/agent-src/commands/estimate-ticket.md +1 -1
- package/dist/agent-src/commands/feature/explore.md +3 -3
- package/dist/agent-src/commands/feature/plan.md +1 -1
- package/dist/agent-src/commands/fix/ci.md +17 -3
- package/dist/agent-src/commands/fix/commit-messages.md +48 -23
- package/dist/agent-src/commands/fix/pr-comments.md +3 -6
- package/dist/agent-src/commands/implement-ticket.md +3 -3
- package/dist/agent-src/commands/memory/add.md +4 -16
- package/dist/agent-src/commands/memory/load.md +5 -6
- package/dist/agent-src/commands/memory/promote.md +3 -16
- package/dist/agent-src/commands/mission/upgrade.md +3 -2
- package/dist/agent-src/commands/optimize/agents-dir.md +2 -2
- package/dist/agent-src/commands/optimize/deep.md +4 -2
- package/dist/agent-src/commands/optimize/rtk.md +4 -26
- package/dist/agent-src/commands/pr/create/description-only.md +18 -15
- package/dist/agent-src/commands/pr/create.md +42 -34
- package/dist/agent-src/commands/pr/merge.md +136 -9
- package/dist/agent-src/commands/prepare-for-review.md +13 -11
- package/dist/agent-src/commands/project/analyze.md +7 -35
- package/dist/agent-src/commands/refine-ticket.md +1 -1
- package/dist/agent-src/commands/review/changes.md +14 -19
- package/dist/agent-src/commands/roadmap/next.md +10 -1
- package/dist/agent-src/commands/roadmap/process-full.md +52 -38
- package/dist/agent-src/commands/roadmap/resolve-blockers.md +64 -14
- package/dist/agent-src/commands/worktree/create.md +7 -3
- package/dist/agent-src/commands/worktree/verify.md +2 -1
- package/dist/agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +5 -3
- package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +7 -9
- package/dist/agent-src/contexts/contracts/command-suggestion-flow.md +8 -6
- package/dist/agent-src/contexts/contracts/frugality-charter.md +8 -5
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +1 -1
- package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +0 -1
- package/dist/agent-src/contexts/execution/evidence-discipline.md +2 -2
- package/dist/agent-src/contexts/execution/non-interactive-contract.md +5 -8
- package/dist/agent-src/contexts/execution/rdp-gate.md +4 -4
- package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +9 -8
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +67 -52
- package/dist/agent-src/contexts/execution/subagent-routing.md +8 -8
- package/dist/agent-src/contexts/execution/subagent-steering.md +6 -4
- package/dist/agent-src/contexts/execution/terminal-states.md +2 -2
- package/dist/agent-src/contexts/execution/toolchain-resolver.md +4 -10
- package/dist/agent-src/contexts/subagent-configuration.md +1 -1
- package/dist/agent-src/guidelines/agent-infra/active-remediation-mechanics.md +39 -0
- package/dist/agent-src/guidelines/agent-infra/context-hygiene-mechanics.md +1 -1
- package/dist/agent-src/guidelines/agent-infra/cross-source-consistency-mechanics.md +8 -10
- package/dist/agent-src/guidelines/agent-infra/frontier-reasoning-operating-profile.md +3 -2
- package/dist/agent-src/guidelines/agent-infra/layered-settings.md +13 -1
- package/dist/agent-src/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
- package/dist/agent-src/guidelines/agent-infra/self-improvement-pipeline.md +10 -3
- package/dist/agent-src/guidelines/agent-infra/size-and-scope.md +36 -0
- package/dist/agent-src/guidelines/design-antipatterns.md +1 -1
- package/dist/agent-src/guidelines/php/git.md +15 -2
- package/dist/agent-src/rules/active-remediation.md +0 -1
- package/dist/agent-src/rules/analysis-skill-routing.md +0 -1
- package/dist/agent-src/rules/architecture.md +0 -1
- package/dist/agent-src/rules/artifact-drafting-protocol.md +0 -1
- package/dist/agent-src/rules/artifact-engagement-recording.md +0 -1
- package/dist/agent-src/rules/augment-edit-discipline.md +0 -1
- package/dist/agent-src/rules/autonomous-execution.md +0 -1
- package/dist/agent-src/rules/brand-consistency.md +0 -1
- package/dist/agent-src/rules/brand-source-of-truth.md +0 -1
- package/dist/agent-src/rules/broken-access-control.md +0 -1
- package/dist/agent-src/rules/cli-output-handling.md +0 -1
- package/dist/agent-src/rules/code-comment-discipline.md +0 -1
- package/dist/agent-src/rules/code-provenance.md +0 -1
- package/dist/agent-src/rules/command-suggestion-policy.md +0 -1
- package/dist/agent-src/rules/commit-conventions.md +1 -2
- package/dist/agent-src/rules/communication-through-line.md +1 -2
- package/dist/agent-src/rules/content-quoting-floor.md +1 -2
- package/dist/agent-src/rules/context-hygiene.md +5 -5
- package/dist/agent-src/rules/copilot-routing.md +1 -2
- package/dist/agent-src/rules/council-availability.md +4 -4
- package/dist/agent-src/rules/cross-source-consistency.md +4 -6
- package/dist/agent-src/rules/decision-revisit-gate.md +2 -3
- package/dist/agent-src/rules/delegation-policy.md +2 -3
- package/dist/agent-src/rules/design-fidelity.md +0 -1
- package/dist/agent-src/rules/design-review-after-ui-write.md +3 -3
- package/dist/agent-src/rules/devcontainer-routing.md +1 -2
- package/dist/agent-src/rules/doc-screenshot-hygiene.md +0 -1
- package/dist/agent-src/rules/docker-commands.md +0 -1
- package/dist/agent-src/rules/domain-adoption-policy.md +0 -1
- package/dist/agent-src/rules/domain-safety-disclaimer.md +0 -1
- package/dist/agent-src/rules/domain-safety-pii.md +0 -1
- package/dist/agent-src/rules/domain-safety-retention.md +0 -1
- package/dist/agent-src/rules/downstream-changes.md +0 -1
- package/dist/agent-src/rules/engineering-safety-floor.md +0 -1
- package/dist/agent-src/rules/external-code-graph-interop.md +0 -1
- package/dist/agent-src/rules/external-reference-deep-dive.md +0 -1
- package/dist/agent-src/rules/fast-path-marker-visibility.md +1 -2
- package/dist/agent-src/rules/finance-safety-floor.md +0 -1
- package/dist/agent-src/rules/fix-what-you-see.md +6 -32
- package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +0 -1
- package/dist/agent-src/rules/git-history-discipline.md +1 -2
- package/dist/agent-src/rules/guidelines.md +0 -1
- package/dist/agent-src/rules/history-discipline.md +0 -1
- package/dist/agent-src/rules/icon-consistency.md +0 -1
- package/dist/agent-src/rules/image-likeness-and-rights.md +0 -1
- package/dist/agent-src/rules/improve-before-implement.md +0 -1
- package/dist/agent-src/rules/invite-challenge.md +0 -1
- package/dist/agent-src/rules/laravel-routing.md +1 -2
- package/dist/agent-src/rules/laravel-translations.md +0 -1
- package/dist/agent-src/rules/legal-safety-floor.md +0 -1
- package/dist/agent-src/rules/lethal-trifecta-guard.md +0 -1
- package/dist/agent-src/rules/linked-projects-onboarding-gate.md +0 -1
- package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +0 -1
- package/dist/agent-src/rules/markdown-safe-codeblocks.md +0 -1
- package/dist/agent-src/rules/media-governance-routing.md +1 -2
- package/dist/agent-src/rules/media-sync-ground-truth.md +0 -1
- package/dist/agent-src/rules/minimal-safe-diff.md +0 -1
- package/dist/agent-src/rules/missing-skill-recovery.md +0 -1
- package/dist/agent-src/rules/missing-tool-handling.md +0 -1
- package/dist/agent-src/rules/model-recommendation.md +0 -1
- package/dist/agent-src/rules/neighbour-precedence.md +64 -0
- package/dist/agent-src/rules/no-attribution-footers.md +0 -1
- package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +0 -1
- package/dist/agent-src/rules/no-pr-progress-comments.md +0 -1
- package/dist/agent-src/rules/no-roadmap-references.md +0 -1
- package/dist/agent-src/rules/notes-first-reasoning.md +0 -1
- package/dist/agent-src/rules/onboarding-gate.md +0 -1
- package/dist/agent-src/rules/output-discipline.md +0 -1
- package/dist/agent-src/rules/package-ci-checks.md +0 -1
- package/dist/agent-src/rules/persona-governance.md +2 -3
- package/dist/agent-src/rules/php-coding.md +0 -1
- package/dist/agent-src/rules/prefer-enums-over-literals.md +0 -1
- package/dist/agent-src/rules/preservation-guard.md +0 -1
- package/dist/agent-src/rules/provider-lifecycle-discipline.md +2 -3
- package/dist/agent-src/rules/question-not-instruction.md +0 -1
- package/dist/agent-src/rules/reviewer-awareness.md +0 -1
- package/dist/agent-src/rules/roadmap-ci-steps-policy.md +0 -1
- package/dist/agent-src/rules/roadmap-progress-sync.md +3 -6
- package/dist/agent-src/rules/role-mode-adherence.md +0 -1
- package/dist/agent-src/rules/rule-type-governance.md +0 -1
- package/dist/agent-src/rules/runtime-safety.md +0 -1
- package/dist/agent-src/rules/scale-discipline.md +0 -1
- package/dist/agent-src/rules/secret-vcs-guard.md +0 -1
- package/dist/agent-src/rules/security-sensitive-stop.md +0 -1
- package/dist/agent-src/rules/self-repair-loop.md +0 -1
- package/dist/agent-src/rules/senior-engineering-discipline.md +0 -1
- package/dist/agent-src/rules/session-canary.md +0 -1
- package/dist/agent-src/rules/settings-ask-protocol.md +5 -6
- package/dist/agent-src/rules/size-enforcement.md +0 -1
- package/dist/agent-src/rules/skill-improvement-trigger.md +2 -3
- package/dist/agent-src/rules/skill-quality.md +0 -1
- package/dist/agent-src/rules/slash-command-routing-policy.md +0 -1
- package/dist/agent-src/rules/source-confidentiality.md +0 -1
- package/dist/agent-src/rules/source-discovery-gate.md +0 -1
- package/dist/agent-src/rules/source-of-truth.md +0 -1
- package/dist/agent-src/rules/spreadsheet-source-quality.md +1 -2
- package/dist/agent-src/rules/strategy-safety-floor.md +0 -1
- package/dist/agent-src/rules/symfony-routing.md +1 -2
- package/dist/agent-src/rules/think-before-action.md +0 -1
- package/dist/agent-src/rules/token-budget-discipline.md +14 -48
- package/dist/agent-src/rules/token-efficiency.md +0 -1
- package/dist/agent-src/rules/token-optimizer-maintenance.md +0 -1
- package/dist/agent-src/rules/tool-safety.md +0 -1
- package/dist/agent-src/rules/ui-audit-gate.md +1 -2
- package/dist/agent-src/rules/untrusted-input-defense.md +0 -1
- package/dist/agent-src/rules/upstream-proposal.md +0 -1
- package/dist/agent-src/rules/user-interaction.md +0 -1
- package/dist/agent-src/rules/user-interrupt-priority.md +0 -1
- package/dist/agent-src/scripts/gate_budget.ts +47 -23
- package/dist/agent-src/scripts/gate_execute.ts +12 -4
- package/dist/agent-src/skills/accessibility-auditor/data/aria-patterns.csv +2 -0
- package/dist/agent-src/skills/accessibility-auditor/data/manifest.json +3 -3
- package/dist/agent-src/skills/ai-council/SKILL.md +7 -4
- package/dist/agent-src/skills/ai-council/references/cost-and-redaction.md +21 -11
- package/dist/agent-src/skills/ai-council/references/procedure.md +12 -6
- package/dist/agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
- package/dist/agent-src/skills/bug-analyzer/SKILL.md +1 -1
- package/dist/agent-src/skills/canvas-design/SKILL.md +4 -2
- package/dist/agent-src/skills/command-routing/SKILL.md +3 -4
- package/dist/agent-src/skills/conventional-commits-writing/SKILL.md +127 -139
- package/dist/agent-src/skills/corpus-grounding/ATTRIBUTION.md +39 -0
- package/dist/agent-src/skills/corpus-grounding/SKILL.md +8 -2
- package/dist/agent-src/skills/database/data/manifest.json +2 -2
- package/dist/agent-src/skills/database/data/query-tuning.csv +13 -13
- package/dist/agent-src/skills/design-intelligence/references/integration-mapping.md +13 -10
- package/dist/agent-src/skills/design-system-capture/SKILL.md +0 -3
- package/dist/agent-src/skills/estimate-ticket/SKILL.md +1 -1
- package/dist/agent-src/skills/fe-design/references/design-patterns.md +49 -2
- package/dist/agent-src/skills/feature-planning/SKILL.md +1 -1
- package/dist/agent-src/skills/frontend-render-security/SKILL.md +9 -0
- package/dist/agent-src/skills/git-workflow/SKILL.md +44 -44
- package/dist/agent-src/skills/git-workflow/references/branch-update.md +312 -0
- package/dist/agent-src/skills/git-workflow/references/commit-subject.md +205 -0
- package/dist/agent-src/skills/iconography/SKILL.md +4 -2
- package/dist/agent-src/skills/image-provider-routing/SKILL.md +16 -5
- package/dist/agent-src/skills/jira-integration/SKILL.md +3 -3
- package/dist/agent-src/skills/logo-generation/SKILL.md +12 -8
- package/dist/agent-src/skills/merge-conflicts/SKILL.md +10 -4
- package/dist/agent-src/skills/po-discovery/SKILL.md +1 -1
- package/dist/agent-src/skills/refine-ticket/SKILL.md +4 -4
- package/dist/agent-src/skills/roadmap-writing/SKILL.md +2 -2
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +4 -2
- package/dist/agent-src/skills/source-discovery/SKILL.md +1 -1
- package/dist/agent-src/skills/svg-authoring/SKILL.md +318 -0
- package/dist/agent-src/skills/tailwind-engineer/SKILL.md +3 -1
- package/dist/agent-src/skills/testing-anti-patterns/SKILL.md +1 -1
- package/dist/agent-src/skills/using-git-worktrees/SKILL.md +1 -1
- package/dist/agent-src/skills/verify-repair-loop/SKILL.md +2 -2
- package/dist/agent-src/skills/wireframe/SKILL.md +5 -2
- package/dist/agent-src/templates/AGENTS.md +1 -1
- package/dist/agent-src/templates/agent-settings.md +46 -129
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +3 -3
- package/dist/agent-src/templates/command.md +2 -2
- package/dist/agent-src/templates/roadmaps.md +6 -1
- package/dist/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +0 -6
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +11 -7
- package/dist/agent-src/templates/scripts/work_engine/hooks/builtin/decision_trace.ts +3 -2
- package/dist/agent-src/templates/scripts/work_engine/hooks/builtin/memory_visibility.ts +2 -1
- package/dist/agent-src/templates/scripts/work_engine/hooks/settings.ts +0 -6
- package/dist/agent-src/templates/scripts/work_engine/scoring/decision_engine.ts +9 -12
- package/dist/agent-src/templates/scripts/work_engine/scoring/memory_visibility.ts +2 -1
- package/dist/agent-src/templates/skill.md +1 -1
- package/dist/cli/commands/uiRender.js +201 -4
- package/dist/cli/commands/uiRenderAsset.js +1308 -0
- package/dist/cli/commands/uiRenderAssetCompare.js +752 -0
- package/dist/cli/commands/uiRenderAssetGrid.js +265 -0
- package/dist/cli/commands/uiRenderAssetGrounds.js +323 -0
- package/dist/cli/commands/uiRenderAssetIsolation.js +85 -0
- package/dist/cli/commands/uiRenderAssetTypes.js +145 -0
- package/dist/cli/main.js +47 -1
- package/dist/cli/registry.js +2 -1
- package/dist/cli-delegate/check_update_banner.js +195 -119
- package/dist/cli-delegate/{chunk-S4UMZNES.js → chunk-4DBG5K7M.js} +5 -5
- package/dist/cli-delegate/{chunk-TRI6DQZ6.js → chunk-5GPULQBE.js} +60 -42
- package/dist/cli-delegate/{chunk-JQVYKIZA.js → chunk-6SRJTYJS.js} +33 -177
- package/dist/cli-delegate/chunk-6V5FMA3P.js +186 -0
- package/dist/cli-delegate/chunk-6YQC2HLF.js +415 -0
- package/dist/cli-delegate/{chunk-E4XIZDIB.js → chunk-7HKRE54K.js} +1 -64
- package/dist/cli-delegate/{chunk-7HQ52DHU.js → chunk-AL3RZ22D.js} +1 -1
- package/dist/cli-delegate/{chunk-DBH4AHDK.js → chunk-ED7KCMLB.js} +9 -11
- package/dist/cli-delegate/{chunk-NXEILF2K.js → chunk-F3QDG2GT.js} +481 -72
- package/dist/cli-delegate/{chunk-CQWX336L.js → chunk-G5VVIZRC.js} +3 -3
- package/dist/cli-delegate/{chunk-JY2I2DXV.js → chunk-H76PHZBI.js} +137 -60
- package/dist/cli-delegate/chunk-IAYTIIQW.js +67 -0
- package/dist/cli-delegate/{chunk-LIYTLH6O.js → chunk-KXXWJTDO.js} +5 -10
- package/dist/cli-delegate/{chunk-T7L2QK3K.js → chunk-LQOCRFWT.js} +1 -1
- package/dist/cli-delegate/{chunk-S4YWNRKO.js → chunk-MDPPKQCQ.js} +34 -1
- package/dist/cli-delegate/chunk-OAFSJBHH.js +272 -0
- package/dist/cli-delegate/{chunk-GKE7ZVFA.js → chunk-PWX7CKMD.js} +1 -1
- package/dist/cli-delegate/{chunk-NDJLNC6Q.js → chunk-T6BP34WI.js} +1 -0
- package/dist/cli-delegate/{chunk-RQNNW7IF.js → chunk-T7XSJSUQ.js} +433 -632
- package/dist/cli-delegate/{chunk-NQ7WT43P.js → chunk-TMWYUOK4.js} +75 -12
- package/dist/cli-delegate/{chunk-EEHDXSYD.js → chunk-WQWXGIWB.js} +12 -273
- package/dist/cli-delegate/{chunk-QLDHIPWR.js → chunk-XQTPXKFA.js} +1 -1
- package/dist/cli-delegate/cmd_analyze_session.js +223 -43
- package/dist/cli-delegate/cmd_brand_status.js +3 -2
- package/dist/cli-delegate/cmd_conformance.js +489 -238
- package/dist/cli-delegate/cmd_converge.js +3 -3
- package/dist/cli-delegate/cmd_doctor.js +15 -12
- package/dist/cli-delegate/cmd_doctor_neighbours.js +11 -4
- package/dist/cli-delegate/cmd_explain.js +43 -19
- package/dist/cli-delegate/cmd_export.js +10 -10
- package/dist/cli-delegate/cmd_git_convention.js +1851 -0
- package/dist/cli-delegate/cmd_handoff.js +40 -21
- package/dist/cli-delegate/cmd_mcp_available.js +3 -2
- package/dist/cli-delegate/cmd_migrate.js +3 -3
- package/dist/cli-delegate/cmd_packs_active.js +4 -3
- package/dist/cli-delegate/cmd_prune.js +10 -10
- package/dist/cli-delegate/cmd_route_audit.js +7 -7
- package/dist/cli-delegate/cmd_route_explain.js +5 -5
- package/dist/cli-delegate/cmd_session_recycle.js +9 -7
- package/dist/cli-delegate/cmd_settings_check.js +54 -7
- package/dist/cli-delegate/cmd_settings_get.js +18 -8
- package/dist/cli-delegate/cmd_settings_migrate.js +10 -10
- package/dist/cli-delegate/cmd_settings_set.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +10 -10
- package/dist/cli-delegate/cmd_uninstall.js +10 -10
- package/dist/cli-delegate/cmd_update.js +7 -7
- package/dist/cli-delegate/cmd_upgrade.js +7 -7
- package/dist/cli-delegate/cmd_validate.js +10 -10
- package/dist/cli-delegate/cmd_versions.js +5 -5
- package/dist/cli-delegate/gate_budget.js +1 -1
- package/dist/cli-delegate/gate_execute.js +2 -2
- package/dist/cli-delegate/roadmap_gates.js +2 -2
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +171 -107
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +7 -7
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +41 -22
- package/dist/discovery/trust-report.md +3 -3
- package/dist/discovery/workspaces.json +16 -11
- package/dist/hooks/dispatch.js +2520 -1924
- package/dist/hooks/dispatch.sha256 +1 -1
- package/dist/hooks/svg_rules.chunk.cjs +1626 -0
- package/dist/hooks/svg_rules.chunk.cjs.sha256 +1 -0
- package/dist/install/install.mjs +462 -431
- package/dist/install/installThinLayer.js +40 -12
- package/dist/install/installedRuleLinks.js +105 -19
- package/dist/mcp/awesome-mcp-servers.row.md +1 -1
- package/dist/mcp/mcp-cloudflare-catalogue.json +2 -2
- package/dist/mcp/registry-manifest.json +5 -5
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +3063 -2160
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_settings.js +15 -120
- package/dist/scripts/_lib/compile_time_toggles.js +12 -21
- package/dist/scripts/_lib/git_convention.js +232 -0
- package/dist/scripts/_lib/global_deploy_inventory.js +730 -0
- package/dist/scripts/_lib/installed_layer.js +344 -18
- package/dist/scripts/_lib/package_root.js +68 -0
- package/dist/scripts/_lib/rule_law_section.js +1 -1
- package/dist/scripts/_lib/scan_scope.js +105 -0
- package/dist/scripts/_lib/settings_removed_keys.js +168 -0
- package/dist/scripts/_lib/svg_dom.js +284 -0
- package/dist/scripts/_lib/svg_geometry.js +477 -0
- package/dist/scripts/_lib/svg_motion.js +179 -0
- package/dist/scripts/_lib/svg_rules.js +1337 -0
- package/dist/scripts/_lib/svg_urls.js +67 -0
- package/dist/scripts/_lib/thin_rules.js +80 -3
- package/dist/scripts/lint_svg_asset.js +324 -0
- package/dist/server/app.js +2 -1
- package/dist/server/gitKeysGate.js +105 -0
- package/dist/server/routes/settings.js +67 -8
- package/dist/server/routes/wizard.js +4 -0
- package/dist/server/schemas/settings.js +23 -81
- package/dist/shared/skillRanking.js +30 -4
- package/dist/ui/assets/{index-Cwq4d0hX.js → index-C3djEJah.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/docs/MIGRATION.md +72 -1
- package/docs/contracts/settings-classes.md +35 -65
- package/docs/guidelines/agent-infra/active-remediation-mechanics.md +39 -0
- package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +1 -1
- package/docs/guidelines/agent-infra/cross-source-consistency-mechanics.md +8 -10
- package/docs/guidelines/agent-infra/frontier-reasoning-operating-profile.md +3 -2
- package/docs/guidelines/agent-infra/layered-settings.md +13 -1
- package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
- package/docs/guidelines/agent-infra/self-improvement-pipeline.md +10 -3
- package/docs/guidelines/agent-infra/size-and-scope.md +36 -0
- package/docs/guidelines/design-antipatterns.md +1 -1
- package/docs/guidelines/php/git.md +15 -2
- package/package.json +4 -3
- package/src/agent-src/scripts/gate_budget.ts +47 -23
- package/src/agent-src/scripts/gate_execute.ts +12 -4
- package/src/agent-src/templates/AGENTS.md +1 -1
- package/src/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +0 -6
- package/src/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +11 -7
- package/src/agent-src/templates/scripts/work_engine/hooks/builtin/decision_trace.ts +3 -2
- package/src/agent-src/templates/scripts/work_engine/hooks/builtin/memory_visibility.ts +2 -1
- package/src/agent-src/templates/scripts/work_engine/hooks/settings.ts +0 -6
- package/src/agent-src/templates/scripts/work_engine/scoring/decision_engine.ts +9 -12
- package/src/agent-src/templates/scripts/work_engine/scoring/memory_visibility.ts +2 -1
- package/src/config/agent-settings.template.yml +79 -312
- package/src/config/agents-paths.yml +16 -0
- package/src/config/assurance-capability-registry.json +7 -3
- package/src/config/ci-local-parity.yml +3 -0
- package/src/config/continuity-surface.json +3 -3
- package/src/config/discovery/packs.yml +17 -1
- package/src/config/evaluator-budgets.json +19 -6
- package/src/config/gate-coverage.yml +65 -23
- package/src/config/gate-violation-baselines.json +56 -16
- package/src/config/gitignore-block.txt +19 -0
- package/src/config/hook-bundle-budget.json +1 -1
- package/src/config/release-gate-locality.yml +2 -1
- package/src/config/routing-coverage-seed.json +55 -6
- package/src/config/rule-law-ceilings.json +12 -6
- package/src/config/rule-obligations.json +833 -0
- package/src/install/installThinLayer.ts +76 -10
- package/src/install/installedRuleLinks.ts +105 -17
- package/src/scripts/_cli/cmd_analyze_session.ts +9 -15
- package/src/scripts/_cli/cmd_conformance.ts +13 -2
- package/src/scripts/_cli/cmd_doctor.ts +10 -10
- package/src/scripts/_cli/cmd_doctor_neighbours.ts +133 -0
- package/src/scripts/_cli/cmd_explain.ts +72 -14
- package/src/scripts/_cli/cmd_git_convention.ts +637 -0
- package/src/scripts/_cli/cmd_settings_check.ts +66 -8
- package/src/scripts/_cli/cmd_settings_get.ts +18 -3
- package/src/scripts/_cli/doctor_execution.ts +72 -1
- package/src/scripts/_dispatch.bash +37 -2
- package/src/scripts/_lib/agent_settings.ts +15 -124
- package/src/scripts/_lib/blocked_by_marker.ts +1 -1
- package/src/scripts/_lib/compile_time_toggles.ts +12 -21
- package/src/scripts/_lib/dispatch_import_closure.ts +163 -0
- package/src/scripts/_lib/git_base_ref.ts +92 -0
- package/src/scripts/_lib/git_convention.ts +291 -0
- package/src/scripts/_lib/git_convention_carrier.ts +389 -0
- package/src/scripts/_lib/git_convention_grammar.ts +246 -0
- package/src/scripts/_lib/git_convention_measure.ts +344 -0
- package/src/scripts/_lib/global_deploy_inventory.ts +74 -0
- package/src/scripts/_lib/graph_feeder_record.ts +236 -13
- package/src/scripts/_lib/installed_layer.ts +448 -23
- package/src/scripts/_lib/knowledge_global.ts +14 -1
- package/src/scripts/_lib/module_reach.ts +456 -0
- package/src/scripts/_lib/neighbour_contradictions.ts +236 -0
- package/src/scripts/_lib/neighbour_tool_use.ts +8 -10
- package/src/scripts/_lib/ratification_artifact.ts +220 -1
- package/src/scripts/_lib/ratification_subject.ts +92 -0
- package/src/scripts/_lib/release_findings_ingest.ts +15 -7
- package/src/scripts/_lib/release_highlights.ts +5 -0
- package/src/scripts/_lib/rule_law_section.ts +1 -1
- package/src/scripts/_lib/rule_obligations.ts +205 -0
- package/src/scripts/_lib/self_repair.ts +1 -1
- package/src/scripts/_lib/settings_removed_keys.ts +173 -0
- package/src/scripts/_lib/svg_dom.ts +318 -0
- package/src/scripts/_lib/svg_geometry.ts +480 -0
- package/src/scripts/_lib/svg_motion.ts +208 -0
- package/src/scripts/_lib/svg_rules.ts +1453 -0
- package/src/scripts/_lib/svg_urls.ts +72 -0
- package/src/scripts/_lib/test_red_state.ts +5 -0
- package/src/scripts/_lib/thin_rules.ts +83 -3
- package/src/scripts/_lib/touched_file_quality.ts +142 -6
- package/src/scripts/_lib/verification_command.ts +59 -0
- package/src/scripts/_lib/verify_clause.ts +27 -17
- package/src/scripts/_lib/worker_budget.ts +1 -1
- package/src/scripts/adr/regenerate_index.ts +16 -1
- package/src/scripts/ai_council/config.ts +7 -7
- package/src/scripts/ai_council/modification_review.ts +100 -0
- package/src/scripts/ai_council/modification_review_questions.ts +90 -0
- package/src/scripts/ai_council/orchestrator.ts +5 -5
- package/src/scripts/ai_council/spend_gate.ts +18 -7
- package/src/scripts/ai_team/config.ts +11 -16
- package/src/scripts/audit_user_type_axis.ts +20 -8
- package/src/scripts/bench_ab_clone.ts +1 -2
- package/src/scripts/bench_concern_spawn_path.ts +129 -0
- package/src/scripts/bench_graph_feeder_latency.ts +584 -0
- package/src/scripts/check_agent_artifact_location.ts +36 -0
- package/src/scripts/check_branch_freshness.ts +147 -24
- package/src/scripts/check_enforcement_coverage.ts +130 -0
- package/src/scripts/check_evaluator_budgets.ts +4 -0
- package/src/scripts/check_finding_dispositions.ts +88 -25
- package/src/scripts/check_gate_coverage.ts +4 -3
- package/src/scripts/check_gate_reachability.ts +48 -1
- package/src/scripts/check_generator_sync.ts +48 -0
- package/src/scripts/check_hook_bundle_composition.ts +107 -0
- package/src/scripts/check_kernel_edit_ratified.ts +86 -6
- package/src/scripts/check_pack_size.ts +1 -1
- package/src/scripts/check_release_manifest_content.ts +189 -0
- package/src/scripts/check_standing_rule_delivery.ts +96 -0
- package/src/scripts/check_suppression_hygiene.ts +2 -5
- package/src/scripts/ci_settle.ts +42 -5
- package/src/scripts/classify_merge_risk.ts +320 -0
- package/src/scripts/closure_scan.ts +91 -1
- package/src/scripts/command_suggester/settings.ts +8 -108
- package/src/scripts/command_suggester/types.ts +4 -5
- package/src/scripts/consumer_matrix.ts +102 -0
- package/src/scripts/context_hygiene_hook.ts +13 -23
- package/src/scripts/cost/preflight.mjs +12 -1
- package/src/scripts/council_cli.ts +7 -7
- package/src/scripts/dispatch_r2_reviewer.ts +24 -11
- package/src/scripts/explain_run.ts +8 -13
- package/src/scripts/generate_git_convention_grammar.ts +127 -0
- package/src/scripts/generate_host_cost_table.ts +20 -3
- package/src/scripts/handoff_context_hook.ts +86 -37
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +25 -6
- package/src/scripts/hooks/block_config_weakening.ts +48 -5
- package/src/scripts/hooks/block_plumbing_writes.ts +8 -4
- package/src/scripts/hooks/block_speaking_inbox_dir.ts +16 -1
- package/src/scripts/hooks/concern_registry.ts +2 -0
- package/src/scripts/hooks/delegation_nudge_hook.ts +2 -3
- package/src/scripts/hooks/design_pass_hook.ts +157 -3
- package/src/scripts/hooks/evidence_independence.ts +12 -4
- package/src/scripts/hooks/mcp_usage_observation_hook.ts +121 -0
- package/src/scripts/hooks/push_settle_hook.ts +4 -3
- package/src/scripts/hooks/rule_inject_hook.ts +44 -3
- package/src/scripts/hooks/state_io.ts +8 -4
- package/src/scripts/hooks/svg_obligation.ts +497 -0
- package/src/scripts/hooks/svg_rules_loader.ts +133 -0
- package/src/scripts/hooks/telemetry_usage_hook.ts +7 -46
- package/src/scripts/hooks/turn_end_gate_hook.ts +6 -3
- package/src/scripts/install-hooks.sh +42 -14
- package/src/scripts/install.ts +7 -31
- package/src/scripts/lint_blocker_citations.ts +198 -0
- package/src/scripts/lint_consolidation_lineage.ts +6 -3
- package/src/scripts/lint_design_quality.ts +60 -12
- package/src/scripts/lint_evidence_artifacts.ts +9 -0
- package/src/scripts/lint_hook_concern_budget.ts +10 -21
- package/src/scripts/lint_motion_authority_drift.ts +27 -0
- package/src/scripts/lint_pack_boundaries.ts +406 -28
- package/src/scripts/lint_roadmap_blockers.ts +282 -29
- package/src/scripts/lint_roadmap_complexity.ts +4 -2
- package/src/scripts/lint_rule_law_section.ts +151 -21
- package/src/scripts/lint_rule_skill_pack_reach.ts +17 -0
- package/src/scripts/lint_settings_classes.ts +1 -1
- package/src/scripts/lint_svg_asset.ts +365 -0
- package/src/scripts/lint_ticked_unmet_criteria.ts +165 -0
- package/src/scripts/lint_workflow_security.ts +12 -1
- package/src/scripts/measure_skill_ranker_baseline.ts +5 -0
- package/src/scripts/model_rule_injection.ts +3 -3
- package/src/scripts/onboarding_gate_hook.ts +7 -6
- package/src/scripts/print_required_checks.ts +15 -3
- package/src/scripts/probe_host_compliance.ts +33 -5
- package/src/scripts/probe_turnaround.ts +183 -3
- package/src/scripts/ratification_header.ts +77 -0
- package/src/scripts/refusal_envelope.ts +138 -0
- package/src/scripts/release_publication.ts +29 -3
- package/src/scripts/report_dispatch_import_closure.ts +76 -0
- package/src/scripts/report_installed_rule_links.ts +118 -1
- package/src/scripts/report_module_reach.ts +212 -0
- package/src/scripts/report_obligation_mechanism.ts +16 -18
- package/src/scripts/report_parked_blockers.ts +222 -0
- package/src/scripts/report_required_checks_drift.ts +196 -0
- package/src/scripts/report_skill_ranker_confusion.ts +103 -2
- package/src/scripts/report_standing_payload_by_host.ts +1 -1
- package/src/scripts/routing_doctor.ts +2 -2
- package/src/scripts/schemas/agent-settings.schema.json +17 -31
- package/src/scripts/schemas/command.schema.json +1 -1
- package/src/scripts/schemas/skill.schema.json +1 -1
- package/src/scripts/self_review_gate.ts +39 -2
- package/src/scripts/skill_tools/score_skill_relevance.ts +28 -19
- package/src/scripts/sync_pr_branch.ts +403 -132
- package/src/scripts/trigger_eval_grandfather.json +0 -16
- package/src/server/schemas/settings.ts +33 -177
- package/src/shared/skillRanking.ts +53 -4
- package/dist/cli-delegate/chunk-NYX3L2PZ.js +0 -99
- package/src/scripts/_lib/config_chain.ts +0 -477
- package/src/scripts/_lib/conformance_report.ts +0 -403
- package/src/scripts/_lib/eval_discrimination.ts +0 -95
- package/src/scripts/_lib/evaluator_promotion.ts +0 -225
- package/src/scripts/_lib/file_slicer.ts +0 -117
- package/src/scripts/_lib/legacy_boundary_map.ts +0 -228
- package/src/scripts/_lib/minimality_tiebreak.ts +0 -168
- package/src/scripts/_lib/overbuild_lens_contract.ts +0 -196
- package/src/scripts/_lib/role_split.ts +0 -338
|
@@ -14,20 +14,37 @@
|
|
|
14
14
|
* the result, so no in-process path can move an exit code. It is NOT a claim
|
|
15
15
|
* about latency, and an earlier version of this paragraph said "costs the turn
|
|
16
16
|
* nothing", which a review correctly read as one: a stop in a repository with a
|
|
17
|
-
* graph pays a `git status` spawn, a graph open and an `untested` walk.
|
|
18
|
-
* measures
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* graph pays a `git status` spawn, a graph open and an `untested` walk.
|
|
18
|
+
* `bench_graph_feeder_latency.ts` measures it, and over a large index the graph
|
|
19
|
+
* open dominates. A host that timed a stop
|
|
20
|
+
* hook out would drop the gate's refusal — a failure the comparative exit-code
|
|
21
|
+
* test cannot see, because both of its runs complete. Step 3.4 — promoting the
|
|
21
22
|
* graph verdict into F — is DEFERRED behind step 3.3's recall measurement and
|
|
22
23
|
* behind an owner amendment to ADR-277, and nothing here anticipates it.
|
|
23
24
|
*
|
|
24
25
|
* WHAT A ROW MAY CONTAIN. The fields are a closed set of enums, counts and
|
|
25
|
-
*
|
|
26
|
-
* body, a reply or a command — the same
|
|
27
|
-
* `domain-safety-pii` § Surface 2 asks
|
|
28
|
-
* `ToolCall` already has. Paths are in the set
|
|
29
|
-
* human labeller needs in step 3.3 and because
|
|
30
|
-
* already quotes them; they are capped so one turn
|
|
26
|
+
* source paths, repo-relative wherever the edit lay inside the workspace. There
|
|
27
|
+
* is no field able to hold a prompt, a file body, a reply or a command — the same
|
|
28
|
+
* PII-exclusion-by-construction discipline `domain-safety-pii` § Surface 2 asks
|
|
29
|
+
* of a log line, and the same shape `ToolCall` already has. Paths are in the set
|
|
30
|
+
* because they are the evidence a human labeller needs in step 3.3 and because
|
|
31
|
+
* the gate's own refusal text already quotes them; they are capped so one turn
|
|
32
|
+
* cannot write an unbounded row. An edit OUTSIDE the workspace root is the one
|
|
33
|
+
* shape that could carry identifying content, and {@link buildFeederRow}
|
|
34
|
+
* REDACTS it to {@link OUTSIDE_WORKSPACE} — it does not drop it, which was tried
|
|
35
|
+
* and rejected for the reason recorded at that call site.
|
|
36
|
+
*
|
|
37
|
+
* WHERE THAT PROPERTY ACTUALLY HOLDS, stated at its real width. The redaction
|
|
38
|
+
* lives in `buildFeederRow`, so it covers every row THIS module builds, which is
|
|
39
|
+
* every row anything writes today. It is not enforced by the TYPE:
|
|
40
|
+
* `GraphFeederRow.paths` is a plain `string[]` and {@link appendFeederRow} is
|
|
41
|
+
* exported and checks nothing, so a future second writer could persist an
|
|
42
|
+
* unredacted path with no compile error and no runtime guard. A completion
|
|
43
|
+
* review pointed out that the previous wording — "true by construction" without
|
|
44
|
+
* qualification — claimed exactly the convention it was disclaiming. The
|
|
45
|
+
* field-shape half of the header IS by construction: there is no field a prompt
|
|
46
|
+
* or a file body could occupy. The path-redaction half is by call site, and the
|
|
47
|
+
* two are worth not conflating.
|
|
31
48
|
*/
|
|
32
49
|
import * as fs from 'node:fs';
|
|
33
50
|
import * as path from 'node:path';
|
|
@@ -39,6 +56,16 @@ import { untested } from '../code_graph/verbs.js';
|
|
|
39
56
|
/** At most this many edit paths per row. */
|
|
40
57
|
const MAX_PATHS = 5;
|
|
41
58
|
|
|
59
|
+
/**
|
|
60
|
+
* What a row stores in place of an edit that lay outside the workspace root.
|
|
61
|
+
*
|
|
62
|
+
* Not a path, deliberately: it carries no directory, no user name and no
|
|
63
|
+
* project name, so it cannot be an egress surface when `paths` is handed to an
|
|
64
|
+
* external labeller. It still tells that labeller an edit happened out of tree,
|
|
65
|
+
* which is the difference between answering `cannot tell` and being misled.
|
|
66
|
+
*/
|
|
67
|
+
export const OUTSIDE_WORKSPACE = '<outside-workspace>';
|
|
68
|
+
|
|
42
69
|
/**
|
|
43
70
|
* At most this many rows per session file.
|
|
44
71
|
*
|
|
@@ -94,6 +121,147 @@ export function feederFile(workspaceRoot: string, sessionKey: string): string {
|
|
|
94
121
|
return path.join(workspaceRoot, 'agents', 'state', 'graph-feeder', `${sessionKey}.jsonl`);
|
|
95
122
|
}
|
|
96
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Put edit paths into the shape the graph indexes them in.
|
|
126
|
+
*
|
|
127
|
+
* THE DEFECT THIS REPAIRS, measured before it was fixed. `ToolCall.path` carries
|
|
128
|
+
* whatever the host wrote into `file_path`, and Claude Code writes an ABSOLUTE
|
|
129
|
+
* path. The graph keys its node ids on repo-relative paths, so `seedsForFiles`
|
|
130
|
+
* resolved nothing, `untested` returned an empty seed set, and the feeder wrote
|
|
131
|
+
* `no-seeds`. 19 accrued rows carried a path; the 18 that reached the graph at
|
|
132
|
+
* all recorded `no-seeds`, and the nineteenth was skipped on `behind:0`. Not one
|
|
133
|
+
* of them was a fact about the code: the graph arm was mute for its whole
|
|
134
|
+
* accrual window. Probed at `c58d7eae` against the real index —
|
|
135
|
+
* `src/scripts/check_memory.ts` resolves 60 seeds relative and 0 absolute.
|
|
136
|
+
*
|
|
137
|
+
* It survived review because every fixture fed a relative path. A test never run
|
|
138
|
+
* against the shape the host emits cannot see this, which is why the regression
|
|
139
|
+
* test added with this fix is written against the absolute form.
|
|
140
|
+
*
|
|
141
|
+
* Repaired HERE rather than at the one call site, because `graphUntestedVerdict`
|
|
142
|
+
* is exported and a second caller would meet the same silence.
|
|
143
|
+
*
|
|
144
|
+
* A path outside the workspace root is returned unchanged: it is not addressable
|
|
145
|
+
* in the graph under any spelling, and rewriting it to `../..` would turn an
|
|
146
|
+
* honest `no-seeds` into a relative-looking string that still indexes nothing.
|
|
147
|
+
*
|
|
148
|
+
* SEPARATORS ARE NORMALISED TO POSIX, and that is not cosmetic. The indexer
|
|
149
|
+
* writes `source_file` through its own `toPosixRel`, and the store matches it by
|
|
150
|
+
* exact string, so on a host whose `path.sep` is a backslash a raw
|
|
151
|
+
* `path.relative` would emit `src\service.ts`, resolve no seeds, and record
|
|
152
|
+
* `no-seeds` — reintroducing precisely the defect above as a platform-
|
|
153
|
+
* conditional one. Found by the completion review of the commit that first fixed
|
|
154
|
+
* it; neither regression test could have seen it, because both run on one
|
|
155
|
+
* platform.
|
|
156
|
+
*/
|
|
157
|
+
export function toRepoRelative(root: string, paths: readonly string[]): string[] {
|
|
158
|
+
let realRoot: string | null = null;
|
|
159
|
+
return paths.map((p) => {
|
|
160
|
+
if (!path.isAbsolute(p)) return p;
|
|
161
|
+
// RAW FIRST, RESOLVED ONLY AS A FALLBACK. The indexer keys `source_file`
|
|
162
|
+
// through a plain tree walk with NO realpath, so the raw spelling is the
|
|
163
|
+
// one it agrees with. Resolving unconditionally fixes a symlinked ROOT
|
|
164
|
+
// and breaks the opposite shape: an in-tree file reached through an
|
|
165
|
+
// in-repo symlink whose target leaves the workspace would relativise to
|
|
166
|
+
// a `..` segment and be redacted off the row — destroying the labelling
|
|
167
|
+
// evidence for a path that is in the tree, which is the harm the
|
|
168
|
+
// redact-rather-than-drop argument exists to prevent. Trying the raw
|
|
169
|
+
// comparison first keeps both: the common case matches the indexer, and
|
|
170
|
+
// the resolved walk is spent only when the raw answer says foreign.
|
|
171
|
+
const raw = _relativeInside(root, p);
|
|
172
|
+
if (raw !== null) return raw;
|
|
173
|
+
realRoot ??= _resolveReal(root);
|
|
174
|
+
return _relativeInside(realRoot, _resolveReal(p)) ?? p;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* `from` -> `to` as a POSIX repo-relative path, or `null` when `to` is outside.
|
|
180
|
+
*
|
|
181
|
+
* `rel === ''` means `to` IS the root, which is emphatically not outside it —
|
|
182
|
+
* folding that into the escape branch made the row say the opposite of the
|
|
183
|
+
* truth. The `..` test is for a leading `..` SEGMENT, not a leading `..` string:
|
|
184
|
+
* `startsWith('..')` also matches an in-tree first segment that merely begins
|
|
185
|
+
* with two dots, such as `..cache/service.ts`.
|
|
186
|
+
*/
|
|
187
|
+
function _relativeInside(from: string, to: string): string | null {
|
|
188
|
+
let rel: string;
|
|
189
|
+
try {
|
|
190
|
+
rel = path.relative(from, to);
|
|
191
|
+
} catch {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
if (rel === '') return '.';
|
|
195
|
+
if (rel === '..' || rel.startsWith(`..${path.sep}`) || path.isAbsolute(rel)) return null;
|
|
196
|
+
return rel.split(path.sep).join('/');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The real location of a path, for comparing one host-supplied string to
|
|
201
|
+
* another.
|
|
202
|
+
*
|
|
203
|
+
* WHY THIS IS NOT OPTIONAL. `workspace_root` and a tool call's `file_path` are
|
|
204
|
+
* two independently produced strings, and they routinely disagree about
|
|
205
|
+
* symlinks: macOS `/tmp` resolves to `/private/tmp`, and a worktree session's
|
|
206
|
+
* project dir can resolve to the parent checkout. Relativising them raw sends
|
|
207
|
+
* EVERY in-repo path down the foreign branch, which would return the graph to
|
|
208
|
+
* `no-seeds` and — now that the row redacts a foreign path — would also destroy
|
|
209
|
+
* the labelling evidence instead of merely failing to resolve it. That is
|
|
210
|
+
* strictly worse than the defect this module was repaired for, and it fails the
|
|
211
|
+
* same way: silently. A completion review found it; no fixture could, because
|
|
212
|
+
* every fixture builds its paths from the same realpathed root string.
|
|
213
|
+
*
|
|
214
|
+
* It walks up to the NEAREST EXISTING ancestor and rejoins the remainder, so a
|
|
215
|
+
* file the turn deleted — or a root that does not exist, as a pure unit test's
|
|
216
|
+
* does — still resolves through whatever part of the chain is real. The walk
|
|
217
|
+
* has to be symmetric or it introduces the very bug it fixes: resolving the root
|
|
218
|
+
* through an existing ancestor while leaving the path unresolved makes the two
|
|
219
|
+
* disagree by exactly the symlink prefix. That asymmetry was in the first
|
|
220
|
+
* version of this function and the suite's own POSIX test caught it.
|
|
221
|
+
*
|
|
222
|
+
* KNOWN REMAINING LIMIT: a case-insensitive filesystem can still present the
|
|
223
|
+
* same file under two spellings this does not reconcile. Named rather than
|
|
224
|
+
* silently assumed away.
|
|
225
|
+
*/
|
|
226
|
+
function _resolveReal(p: string): string {
|
|
227
|
+
const abs = path.resolve(p);
|
|
228
|
+
const tail: string[] = [];
|
|
229
|
+
let cur = abs;
|
|
230
|
+
for (;;) {
|
|
231
|
+
try {
|
|
232
|
+
const real = fs.realpathSync(cur);
|
|
233
|
+
return tail.length === 0 ? real : path.join(real, ...[...tail].reverse());
|
|
234
|
+
} catch {
|
|
235
|
+
const parent = path.dirname(cur);
|
|
236
|
+
// Reached the filesystem root with nothing resolvable — the absolute
|
|
237
|
+
// form is the best answer available, and it is still symmetric
|
|
238
|
+
// because the other side took the same walk.
|
|
239
|
+
if (parent === cur) return abs;
|
|
240
|
+
tail.push(path.basename(cur));
|
|
241
|
+
cur = parent;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Would storing this path put content from outside the workspace on the row?
|
|
248
|
+
*
|
|
249
|
+
* Broader than `path.isAbsolute` on purpose. Two shapes bypass that test while
|
|
250
|
+
* carrying exactly the identifying content the marker exists to withhold from
|
|
251
|
+
* the external labeller: an out-of-tree path already in relative form
|
|
252
|
+
* (`../other-project/x.ts`), and a foreign-platform absolute path, which POSIX
|
|
253
|
+
* `path.isAbsolute` reports as relative. Both were found by a completion review.
|
|
254
|
+
*/
|
|
255
|
+
function _escapesWorkspace(p: string): boolean {
|
|
256
|
+
return (
|
|
257
|
+
path.isAbsolute(p) ||
|
|
258
|
+
path.win32.isAbsolute(p) ||
|
|
259
|
+
p === '..' ||
|
|
260
|
+
p.startsWith('../') ||
|
|
261
|
+
p.startsWith(`..${path.sep}`)
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
97
265
|
/**
|
|
98
266
|
* Run `untested` over the turn's edit paths.
|
|
99
267
|
*
|
|
@@ -112,6 +280,12 @@ export function graphUntestedVerdict(
|
|
|
112
280
|
// change.
|
|
113
281
|
if (state !== 'fresh' && state !== 'edited') return none;
|
|
114
282
|
if (paths.length === 0) return none;
|
|
283
|
+
// The graph indexes repo-relative paths; a host hands us absolute ones.
|
|
284
|
+
// NOT before the early returns below. Relativising walks the filesystem once
|
|
285
|
+
// per absolute path, and this runs inside a stop hook whose latency the
|
|
286
|
+
// module header names as a risk — a host that timed the hook out
|
|
287
|
+
// would drop the gate's refusal. Spending those syscalls only to discover
|
|
288
|
+
// there is no usable source is cost for nothing.
|
|
115
289
|
let picked;
|
|
116
290
|
try {
|
|
117
291
|
picked = pickSource(detectSources(root, path.join(root, NATIVE_CACHE_REL)));
|
|
@@ -126,7 +300,7 @@ export function graphUntestedVerdict(
|
|
|
126
300
|
return none;
|
|
127
301
|
}
|
|
128
302
|
try {
|
|
129
|
-
const r = untested(g, paths, state);
|
|
303
|
+
const r = untested(g, toRepoRelative(root, paths), state);
|
|
130
304
|
if (r.seeds.length === 0) return { verdict: 'no-seeds', untested: 0, tested: 0 };
|
|
131
305
|
return {
|
|
132
306
|
verdict: r.untested.length > 0 ? 'untested' : 'tested',
|
|
@@ -187,8 +361,32 @@ export function readFeederRows(workspaceRoot: string, sessionKey: string): Graph
|
|
|
187
361
|
}
|
|
188
362
|
}
|
|
189
363
|
|
|
190
|
-
/**
|
|
364
|
+
/**
|
|
365
|
+
* Build the row.
|
|
366
|
+
*
|
|
367
|
+
* NO LONGER PURE, and the previous line of this docstring still claimed it was.
|
|
368
|
+
* Relativising reads the filesystem — `toRepoRelative` falls back to
|
|
369
|
+
* `fs.realpathSync` when the raw comparison says foreign — so this touches disk
|
|
370
|
+
* for any absolute path outside the root, and the unit tests that pass a
|
|
371
|
+
* non-existent `/workspace` root walk real directories on the way to answering.
|
|
372
|
+
* It is still DETERMINISTIC given the tree, which is what the tests actually
|
|
373
|
+
* rely on. A completion review caught the stale claim; in a module whose header
|
|
374
|
+
* argues its guarantees hold by construction rather than by convention, a
|
|
375
|
+
* docstring that has quietly stopped being true is the same defect class as the
|
|
376
|
+
* rest of this change.
|
|
377
|
+
*
|
|
378
|
+
* `root` is required rather than optional, and relativising happens HERE rather
|
|
379
|
+
* than at the call site, for two reasons that point the same way. The caller is
|
|
380
|
+
* `turn_end_gate_hook.ts`, which sits against a shrink-only 1,500-line source
|
|
381
|
+
* budget it is exactly at — so the five lines this would cost there are five
|
|
382
|
+
* lines it does not have, and its own header already says such things belong in
|
|
383
|
+
* `_lib`. And a caller that can omit the root is a caller that can reintroduce
|
|
384
|
+
* the absolute-path defect {@link toRepoRelative} exists to close: the stored
|
|
385
|
+
* paths a step-3.3 labeller reads must be the paths the verdict was taken over.
|
|
386
|
+
*/
|
|
191
387
|
export function buildFeederRow(input: {
|
|
388
|
+
/** The workspace root the paths are made relative to. */
|
|
389
|
+
root: string;
|
|
192
390
|
turn: number;
|
|
193
391
|
layer: FeederLayer;
|
|
194
392
|
state: GraphState;
|
|
@@ -208,7 +406,32 @@ export function buildFeederRow(input: {
|
|
|
208
406
|
graph: input.graph.verdict,
|
|
209
407
|
graph_untested: input.graph.untested,
|
|
210
408
|
graph_tested: input.graph.tested,
|
|
211
|
-
|
|
409
|
+
// An out-of-workspace edit is REDACTED, not dropped and not stored
|
|
410
|
+
// verbatim. After relativising, a still-absolute path is exactly one
|
|
411
|
+
// that lay outside the root.
|
|
412
|
+
//
|
|
413
|
+
// Verbatim is an egress surface: `paths` is handed to external council
|
|
414
|
+
// seats at step 3.3's labelling, and a home-rooted path names a real
|
|
415
|
+
// user and an unrelated project.
|
|
416
|
+
//
|
|
417
|
+
// Dropping it looked right and was worse, which a completion review
|
|
418
|
+
// caught before it shipped. It would have shortened `paths` below
|
|
419
|
+
// `path_count` and so reused the protocol's truncation signal for a
|
|
420
|
+
// second, different cause — two meanings on one wire, with no field
|
|
421
|
+
// separating them. Worse, a turn editing one in-repo file and one file
|
|
422
|
+
// outside the root would then be excluded from labelling altogether,
|
|
423
|
+
// losing a perfectly labellable in-repo path from a corpus that is
|
|
424
|
+
// blocked precisely for want of rows.
|
|
425
|
+
//
|
|
426
|
+
// The marker keeps the lengths equal, so truncation stays the only
|
|
427
|
+
// cause of `path_count > paths.length`; keeps the row honest that an
|
|
428
|
+
// edit happened outside the tree, so a labeller can answer
|
|
429
|
+
// `cannot tell` rather than be silently misled; and carries nothing
|
|
430
|
+
// identifying. The graph's answer is unchanged either way — the probe
|
|
431
|
+
// sees the real path and resolves no seeds for it.
|
|
432
|
+
paths: toRepoRelative(input.root, input.paths.slice(0, MAX_PATHS)).map((p) =>
|
|
433
|
+
_escapesWorkspace(p) ? OUTSIDE_WORKSPACE : p,
|
|
434
|
+
),
|
|
212
435
|
path_count: input.paths.length,
|
|
213
436
|
};
|
|
214
437
|
}
|