@event4u/agent-config 16.1.0 → 16.3.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 +98 -257
- package/README.md +14 -12
- package/dist/agent-src/commands/analyze/inbox.md +1 -1
- package/dist/agent-src/commands/analyze/roadmap-repos.md +1 -1
- package/dist/agent-src/commands/bug/fix.md +17 -2
- package/dist/agent-src/commands/feature/plan.md +1 -1
- package/dist/agent-src/commands/feature/roadmap.md +1 -1
- package/dist/agent-src/commands/fix/ci.md +1 -1
- package/dist/agent-src/commands/implement-ticket.md +1 -1
- package/dist/agent-src/commands/jira-ticket.md +1 -1
- package/dist/agent-src/commands/roadmap/create.md +1 -1
- package/dist/agent-src/commands/roadmap/materialize.md +1 -1
- package/dist/agent-src/commands/roadmap/process-full.md +5 -5
- package/dist/agent-src/commands/roadmap/resolve-blockers.md +361 -0
- package/dist/agent-src/commands/roadmap/triage-parked.md +325 -0
- package/dist/agent-src/commands/roadmap.md +18 -4
- package/dist/agent-src/commands/tests/create.md +17 -3
- package/dist/agent-src/commands/tests/execute.md +22 -5
- package/dist/agent-src/commands/work.md +4 -0
- package/dist/agent-src/contexts/authority/decision-revisit-gate-enforcement.md +43 -0
- package/dist/agent-src/contexts/communication/rules-auto/design-fidelity-enforcement.md +24 -0
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +6 -6
- package/dist/agent-src/contexts/execution/autonomy-mechanics.md +4 -8
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +32 -2
- package/dist/agent-src/contexts/execution/session-canary-enforcement-history.md +67 -0
- package/dist/agent-src/contexts/execution/toolchain-resolver.md +101 -7
- package/dist/agent-src/rules/active-remediation.md +1 -1
- package/dist/agent-src/rules/autonomous-execution.md +1 -0
- package/dist/agent-src/rules/broken-access-control.md +1 -0
- package/dist/agent-src/rules/command-suggestion-policy.md +1 -0
- package/dist/agent-src/rules/context-hygiene.md +1 -1
- package/dist/agent-src/rules/decision-revisit-gate.md +16 -33
- package/dist/agent-src/rules/design-fidelity.md +13 -16
- package/dist/agent-src/rules/doc-screenshot-hygiene.md +1 -0
- package/dist/agent-src/rules/domain-safety-disclaimer.md +1 -0
- package/dist/agent-src/rules/domain-safety-pii.md +1 -0
- package/dist/agent-src/rules/domain-safety-retention.md +1 -0
- package/dist/agent-src/rules/engineering-safety-floor.md +1 -0
- package/dist/agent-src/rules/evaluator-independence.md +3 -2
- package/dist/agent-src/rules/fast-path-marker-visibility.md +1 -0
- package/dist/agent-src/rules/finance-safety-floor.md +1 -0
- package/dist/agent-src/rules/git-history-discipline.md +1 -0
- package/dist/agent-src/rules/image-likeness-and-rights.md +1 -0
- package/dist/agent-src/rules/legal-safety-floor.md +3 -2
- package/dist/agent-src/rules/lethal-trifecta-guard.md +1 -0
- package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +1 -0
- package/dist/agent-src/rules/media-governance-routing.md +14 -17
- package/dist/agent-src/rules/persona-governance.md +2 -2
- package/dist/agent-src/rules/provider-lifecycle-discipline.md +1 -1
- package/dist/agent-src/rules/question-not-instruction.md +1 -0
- package/dist/agent-src/rules/roadmap-progress-sync.md +1 -1
- package/dist/agent-src/rules/runtime-safety.md +1 -0
- package/dist/agent-src/rules/secret-vcs-guard.md +1 -0
- package/dist/agent-src/rules/security-sensitive-stop.md +3 -2
- package/dist/agent-src/rules/session-canary.md +8 -62
- package/dist/agent-src/rules/settings-ask-protocol.md +1 -0
- package/dist/agent-src/rules/source-confidentiality.md +1 -0
- package/dist/agent-src/rules/strategy-safety-floor.md +1 -0
- package/dist/agent-src/rules/tool-safety.md +1 -0
- package/dist/agent-src/rules/ui-audit-gate.md +1 -2
- package/dist/agent-src/rules/untrusted-input-defense.md +1 -0
- package/dist/agent-src/rules/user-interrupt-priority.md +1 -0
- package/dist/agent-src/scripts/archive_completed_roadmaps.ts +115 -20
- package/dist/agent-src/scripts/deferral_carry.ts +339 -0
- package/dist/agent-src/scripts/update_roadmap_progress.ts +4 -1
- package/dist/agent-src/skills/accessibility-auditor/data/aria-patterns.csv +1 -1
- package/dist/agent-src/skills/accessibility-auditor/data/manifest.json +2 -2
- package/dist/agent-src/skills/api-design/data/manifest.json +2 -2
- package/dist/agent-src/skills/api-testing/SKILL.md +17 -0
- package/dist/agent-src/skills/code-intelligence/SKILL.md +14 -2
- package/dist/agent-src/skills/design-review/SKILL.md +30 -4
- package/dist/agent-src/skills/design-review/references/verification-automation.md +32 -0
- package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +1 -1
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +18 -3
- package/dist/agent-src/skills/existing-ui-audit/references/component-taxonomy-detection.md +56 -0
- package/dist/agent-src/skills/fe-design/SKILL.md +1 -1
- package/dist/agent-src/skills/iconography/SKILL.md +1 -1
- package/dist/agent-src/skills/js-library-packaging/SKILL.md +2 -2
- package/dist/agent-src/skills/markitdown/SKILL.md +4 -0
- package/dist/agent-src/skills/monorepo-workspace/SKILL.md +1 -1
- package/dist/agent-src/skills/playwright-testing/SKILL.md +30 -6
- package/dist/agent-src/skills/quality-tools/SKILL.md +11 -1
- package/dist/agent-src/skills/quality-tools/references/go-tools.md +76 -0
- package/dist/agent-src/skills/quality-tools/references/python-tools.md +104 -0
- package/dist/agent-src/skills/review-routing/SKILL.md +2 -2
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +1 -1
- package/dist/agent-src/skills/storybook-workshop/SKILL.md +3 -3
- package/dist/agent-src/skills/tailwind-engineer/SKILL.md +1 -1
- package/dist/agent-src/skills/test-case-discovery/SKILL.md +7 -0
- package/dist/agent-src/skills/test-driven-development/SKILL.md +17 -0
- package/dist/agent-src/skills/test-performance/SKILL.md +19 -1
- package/dist/agent-src/skills/ui-component-architect/SKILL.md +25 -2
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/roadmaps.md +30 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/app_spec.ts +10 -4
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +302 -21
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +22 -3
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +6 -1
- package/dist/agent-src/templates/scripts/work_engine/stack/runner.ts +774 -109
- package/dist/agent-src/templates/scripts/work_engine/state.ts +57 -7
- package/dist/agent-src/templates/scripts/work_engine/taxonomy/detect.ts +500 -0
- package/dist/agent-src/templates/scripts/work_engine/taxonomy/place.ts +183 -0
- package/dist/cli/python/knowledge_ingest.js +1 -1
- package/dist/cli/python/workspace_drive.js +1 -1
- package/dist/cli/registry.js +1 -1
- package/dist/cli-delegate/archive_completed_roadmaps.js +92 -12
- package/dist/cli-delegate/check_update_banner.js +12 -1
- package/dist/cli-delegate/chunk-523HCFYO.js +90 -0
- package/dist/cli-delegate/{chunk-M2DPGFZ4.js → chunk-6V6TA25H.js} +22 -152
- package/dist/cli-delegate/chunk-7IQE3D5S.js +191 -0
- package/dist/cli-delegate/{chunk-6KFEC3G7.js → chunk-CQWX336L.js} +1 -1
- package/dist/cli-delegate/chunk-DEIV7XP7.js +108 -0
- package/dist/cli-delegate/chunk-EEHDXSYD.js +2040 -0
- package/dist/cli-delegate/{chunk-P6ZHP5W2.js → chunk-GKE7ZVFA.js} +4 -4
- package/dist/cli-delegate/chunk-JQOM7TTM.js +1201 -0
- package/dist/cli-delegate/{chunk-UNCRJBT3.js → chunk-JQVYKIZA.js} +41 -0
- package/dist/cli-delegate/{chunk-FC75PGJE.js → chunk-JY2I2DXV.js} +12 -1
- package/dist/cli-delegate/chunk-KB5FZ655.js +208 -0
- package/dist/cli-delegate/{chunk-YUM5KURG.js → chunk-KR6EM23A.js} +235 -1455
- package/dist/cli-delegate/{chunk-LTYVIY76.js → chunk-LIYTLH6O.js} +1 -1
- package/dist/cli-delegate/chunk-NQ7WT43P.js +2729 -0
- package/dist/cli-delegate/chunk-NXEILF2K.js +2160 -0
- package/dist/cli-delegate/{chunk-5R7HOLAF.js → chunk-NYX3L2PZ.js} +1 -1
- package/dist/cli-delegate/{chunk-4E2W63DA.js → chunk-OKJUIAPS.js} +62 -1
- package/dist/cli-delegate/{chunk-QAJS5YWY.js → chunk-PHD7OOLE.js} +2 -1
- package/dist/cli-delegate/{chunk-RGNIWTEA.js → chunk-QLDHIPWR.js} +1 -1
- package/dist/cli-delegate/{chunk-HDVVGPQW.js → chunk-RQNNW7IF.js} +1405 -567
- package/dist/cli-delegate/{chunk-S3VFXMTM.js → chunk-S4UMZNES.js} +1 -1
- package/dist/cli-delegate/{chunk-6KM6ORRY.js → chunk-S4YWNRKO.js} +24 -8
- package/dist/cli-delegate/{chunk-GJCBB2UG.js → chunk-TRI6DQZ6.js} +3054 -325
- package/dist/cli-delegate/chunk-ULQRUR23.js +208 -0
- package/dist/cli-delegate/{chunk-NUHLI2RX.js → chunk-YCU3TIXH.js} +2 -0
- package/dist/cli-delegate/chunk-ZBZV2G5R.js +210 -0
- package/dist/cli-delegate/{chunk-WGXTVKCQ.js → chunk-ZUZKZYCN.js} +5 -3
- package/dist/cli-delegate/cmd_analyze_session.js +1 -1
- package/dist/cli-delegate/cmd_brand_status.js +1 -1
- package/dist/cli-delegate/cmd_conformance.js +1862 -809
- package/dist/cli-delegate/cmd_doctor.js +13 -6
- package/dist/cli-delegate/cmd_doctor_neighbours.js +23 -0
- package/dist/cli-delegate/cmd_explain.js +5 -5
- package/dist/cli-delegate/cmd_export.js +11 -8
- package/dist/cli-delegate/cmd_fleet.js +3 -3
- package/dist/cli-delegate/cmd_handoff.js +10 -7
- package/dist/cli-delegate/cmd_mcp_available.js +1 -1
- package/dist/cli-delegate/cmd_memory_get.js +3 -1
- package/dist/cli-delegate/cmd_migrate.js +2 -2
- package/dist/cli-delegate/cmd_packs_active.js +3 -3
- package/dist/cli-delegate/cmd_preflight.js +6 -6
- package/dist/cli-delegate/cmd_prune.js +11 -8
- package/dist/cli-delegate/cmd_refresh.js +2 -1
- package/dist/cli-delegate/cmd_route_audit.js +8 -6
- package/dist/cli-delegate/cmd_route_explain.js +4 -4
- package/dist/cli-delegate/cmd_session_recycle.js +4 -3
- package/dist/cli-delegate/cmd_settings_get.js +1 -1
- package/dist/cli-delegate/cmd_settings_migrate.js +11 -8
- package/dist/cli-delegate/cmd_settings_set.js +4 -4
- package/dist/cli-delegate/cmd_sync.js +11 -8
- package/dist/cli-delegate/cmd_uninstall.js +11 -8
- package/dist/cli-delegate/cmd_update.js +1 -1
- package/dist/cli-delegate/cmd_upgrade.js +3 -2
- package/dist/cli-delegate/cmd_validate.js +11 -8
- package/dist/cli-delegate/cmd_versions.js +1 -1
- package/dist/cli-delegate/deferral_carry.js +16 -0
- package/dist/cli-delegate/gate_execute.js +2 -2
- package/dist/cli-delegate/roadmap_gates.js +5 -5
- package/dist/cli-delegate/update_roadmap_progress.js +1 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +132 -80
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +3 -3
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +7 -5
- package/dist/discovery/trust-report.md +2 -2
- package/dist/discovery/workspaces.json +6 -4
- package/dist/hooks/dispatch.js +7972 -5186
- package/dist/hooks/dispatch.sha256 +1 -0
- package/dist/install/claudePathsPlan.js +47 -6
- package/dist/install/claudeRuleRewrite.js +7 -0
- package/dist/install/emit_host_rules_cli.js +39 -36
- package/dist/install/globalRuleScope.js +87 -0
- package/dist/install/host_rule_ownership.js +160 -0
- package/dist/install/install.mjs +2226 -1055
- package/dist/install/installThinLayer.js +261 -0
- package/dist/install/installedRuleLinks.js +176 -0
- package/dist/install/wizard-plan.js +24 -0
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +40913 -34865
- package/dist/scripts/_lib/agent_settings.js +11 -0
- package/dist/scripts/_lib/claude_settings_hooks.js +10 -8
- package/dist/scripts/_lib/installed_layer.js +378 -0
- package/dist/scripts/_lib/lean_projection_mode.js +218 -15
- package/dist/scripts/_lib/rule_consequence_class.js +45 -0
- package/dist/scripts/_lib/rule_injection.js +67 -10
- package/dist/scripts/_lib/rule_law_section.js +122 -0
- package/dist/scripts/_lib/thin_rules.js +458 -0
- package/dist/scripts/_lib/windsurf_render.js +60 -0
- package/dist/scripts/condense.js +14 -26
- package/dist/scripts/project_thin_rules.js +14 -294
- package/dist/server/schemas/settings.js +29 -0
- package/dist/shared/skillRanking.js +74 -13
- package/dist/ui/assets/index-Cwq4d0hX.js +23 -0
- package/dist/ui/assets/index-Cyjy8bWO.css +1 -0
- package/dist/ui/index.html +2 -2
- package/docs/contracts/settings-classes.md +10 -6
- package/package.json +4 -4
- package/src/agent-src/scripts/archive_completed_roadmaps.ts +115 -20
- package/src/agent-src/scripts/deferral_carry.ts +339 -0
- package/src/agent-src/scripts/update_roadmap_progress.ts +4 -1
- package/src/agent-src/templates/scripts/work_engine/directives/ui/app_spec.ts +10 -4
- package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +302 -21
- package/src/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +22 -3
- package/src/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +6 -1
- package/src/agent-src/templates/scripts/work_engine/stack/runner.ts +774 -109
- package/src/agent-src/templates/scripts/work_engine/state.ts +57 -7
- package/src/agent-src/templates/scripts/work_engine/taxonomy/detect.ts +500 -0
- package/src/agent-src/templates/scripts/work_engine/taxonomy/place.ts +183 -0
- package/src/config/agent-settings.template.yml +91 -22
- package/src/config/ci-local-parity.yml +18 -0
- package/src/config/continuity-surface.json +9 -2
- package/src/config/evaluator-budgets.json +4 -4
- package/src/config/gate-coverage.yml +327 -3
- package/src/config/gate-violation-baselines.json +21 -9
- package/src/config/hook-bundle-budget.json +25 -0
- package/src/config/hook-latency-budget.json +21 -0
- package/src/config/hook-token-budget.json +8 -3
- package/src/config/host-instruction-limits.json +33 -0
- package/src/config/metric-registry.yml +114 -0
- package/src/config/placeholder-drift-budget.json +10 -0
- package/src/config/routing-coverage-seed.json +38 -3
- package/src/config/rule-activation-census.json +7 -3
- package/src/config/rule-consequence-class.json +161 -0
- package/src/config/rule-law-ceilings.json +99 -0
- package/src/install/claudePathsPlan.ts +46 -4
- package/src/install/claudeRuleRewrite.ts +10 -1
- package/src/install/emit_host_rules_cli.ts +43 -34
- package/src/install/globalRuleScope.ts +109 -0
- package/src/install/host_rule_ownership.ts +170 -0
- package/src/install/installThinLayer.ts +312 -0
- package/src/install/installedRuleLinks.ts +220 -0
- package/src/install/wizard-plan.ts +24 -0
- package/src/scripts/_cli/cmd_doctor.ts +28 -90
- package/src/scripts/_cli/cmd_doctor_neighbours.ts +293 -0
- package/src/scripts/_cli/doctor_execution.ts +100 -17
- package/src/scripts/_cli/doctor_network_posture.ts +226 -0
- package/src/scripts/_dispatch.bash +16 -2
- package/src/scripts/_lib/agent_settings.ts +11 -0
- package/src/scripts/_lib/body_portable.ts +102 -0
- package/src/scripts/_lib/cc_transcript.ts +132 -1
- package/src/scripts/_lib/claude_settings_hooks.ts +10 -8
- package/src/scripts/_lib/concern_sla_window.ts +200 -0
- package/src/scripts/_lib/estate_offsets.ts +241 -0
- package/src/scripts/_lib/exemption_shape.ts +143 -0
- package/src/scripts/_lib/fnv.ts +23 -0
- package/src/scripts/_lib/foreign_scan.ts +106 -0
- package/src/scripts/_lib/forge_protection.ts +114 -0
- package/src/scripts/_lib/forge_reader.ts +558 -0
- package/src/scripts/_lib/gitignore_block.ts +314 -0
- package/src/scripts/_lib/global_deploy_inventory.ts +32 -0
- package/src/scripts/_lib/graph_feeder_record.ts +214 -0
- package/src/scripts/_lib/hook_settings.ts +73 -0
- package/src/scripts/_lib/host_capability.ts +40 -19
- package/src/scripts/_lib/host_env_write.ts +111 -0
- package/src/scripts/_lib/host_hook_merge.ts +165 -0
- package/src/scripts/_lib/installed_layer.ts +538 -0
- package/src/scripts/_lib/json_merge.ts +82 -0
- package/src/scripts/_lib/json_pointers.ts +93 -11
- package/src/scripts/_lib/lean_projection_mode.ts +275 -15
- package/src/scripts/_lib/llm_proposer_transport.ts +14 -4
- package/src/scripts/_lib/machine_wake.ts +16 -3
- package/src/scripts/_lib/neighbour_census.ts +760 -0
- package/src/scripts/_lib/neighbour_scan.ts +122 -0
- package/src/scripts/_lib/neighbour_tool_use.ts +189 -0
- package/src/scripts/_lib/obligations.ts +119 -8
- package/src/scripts/_lib/probe_inputs.ts +271 -0
- package/src/scripts/_lib/prompt_shape.ts +46 -0
- package/src/scripts/_lib/read_surface_scan.ts +322 -0
- package/src/scripts/_lib/release_highlights.ts +2 -1
- package/src/scripts/_lib/release_migration_gate.ts +19 -3
- package/src/scripts/_lib/reserved_name_sweep.ts +73 -0
- package/src/scripts/_lib/retrieval_sanitize.ts +77 -16
- package/src/scripts/_lib/review_coverage.ts +134 -0
- package/src/scripts/_lib/rule_consequence_class.ts +71 -0
- package/src/scripts/_lib/rule_injection.ts +130 -10
- package/src/scripts/_lib/rule_law_section.ts +147 -0
- package/src/scripts/_lib/rule_layer_overlap.ts +58 -0
- package/src/scripts/_lib/shell_write_shapes.ts +108 -0
- package/src/scripts/_lib/skill_origin.ts +254 -0
- package/src/scripts/_lib/structural_hiding.ts +622 -0
- package/src/scripts/_lib/structured_ask.ts +64 -21
- package/src/scripts/_lib/thin_rules.ts +540 -0
- package/src/scripts/_lib/touched_file_quality.ts +434 -0
- package/src/scripts/_lib/turn_end_refusals.ts +600 -4
- package/src/scripts/_lib/turn_end_transcript.ts +216 -0
- package/src/scripts/_lib/verification_command.ts +324 -0
- package/src/scripts/_lib/verification_evidence.ts +647 -0
- package/src/scripts/_lib/verify_clause.ts +280 -0
- package/src/scripts/_lib/windsurf_render.ts +63 -0
- package/src/scripts/ai_council/cli_call_budget.ts +13 -5
- package/src/scripts/ai_council/clients.ts +26 -57
- package/src/scripts/ai_council/config.ts +1 -1
- package/src/scripts/ai_council/vendor_defaults.ts +45 -0
- package/src/scripts/ai_team/team_dispatch.ts +4 -0
- package/src/scripts/audit_skill_overlap.ts +261 -0
- package/src/scripts/before_complete_hook.ts +573 -25
- package/src/scripts/bench_hook_latency.ts +412 -5
- package/src/scripts/bench_touched_file_quality.ts +238 -0
- package/src/scripts/cache_realization_report.ts +61 -1
- package/src/scripts/check_argument_hint.ts +287 -0
- package/src/scripts/check_claims.ts +125 -1
- package/src/scripts/check_enforcement_coverage.ts +38 -9
- package/src/scripts/check_enforcement_matrix.ts +621 -22
- package/src/scripts/check_estate_count.ts +130 -153
- package/src/scripts/check_finding_dispositions.ts +138 -7
- package/src/scripts/check_generator_sync.ts +71 -0
- package/src/scripts/check_hook_bundle_composition.ts +370 -0
- package/src/scripts/check_host_docs_digest.ts +786 -0
- package/src/scripts/check_host_format_column.ts +559 -0
- package/src/scripts/check_input_references.ts +228 -0
- package/src/scripts/check_inputs_parity.ts +235 -0
- package/src/scripts/check_kernel_edit_ratified.ts +89 -9
- package/src/scripts/check_kill_switch_table.ts +294 -0
- package/src/scripts/check_memory.ts +7 -1
- package/src/scripts/check_placeholder_drift.ts +221 -0
- package/src/scripts/check_read_surface_coverage.ts +515 -0
- package/src/scripts/check_release_highlights.ts +10 -0
- package/src/scripts/check_release_holds.ts +2 -1
- package/src/scripts/check_release_pr_shape.ts +38 -15
- package/src/scripts/check_routing_coverage.ts +378 -11
- package/src/scripts/check_standing_rule_delivery.ts +33 -13
- package/src/scripts/check_static_parity.ts +17 -0
- package/src/scripts/check_verify_expectation_delta.ts +521 -0
- package/src/scripts/ci_settle.ts +145 -19
- package/src/scripts/closure_scan.ts +115 -1
- package/src/scripts/code_graph/detect.ts +127 -7
- package/src/scripts/code_graph/foreign.ts +194 -0
- package/src/scripts/code_graph/query.ts +217 -4
- package/src/scripts/code_graph/types.ts +26 -2
- package/src/scripts/code_graph/validate.ts +3 -1
- package/src/scripts/code_graph/verbs.ts +103 -0
- package/src/scripts/compile_hook_manifest.ts +90 -14
- package/src/scripts/condense.ts +14 -27
- package/src/scripts/estate_exemption_shape.ts +202 -0
- package/src/scripts/external_sources_denylist.json +29 -4
- package/src/scripts/generate_host_cost_table.ts +1 -1
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +192 -14
- package/src/scripts/hooks/block_config_weakening.ts +294 -4
- package/src/scripts/hooks/block_kernel_rule_writes.ts +9 -78
- package/src/scripts/hooks/block_plumbing_writes.ts +342 -0
- package/src/scripts/hooks/bundle_integrity.ts +291 -0
- package/src/scripts/hooks/chain_nudge_hook.ts +1 -2
- package/src/scripts/hooks/code_graph_context_hook.ts +253 -25
- package/src/scripts/hooks/comment_discipline_hook.ts +1 -3
- package/src/scripts/hooks/concern_failure_policy.ts +280 -0
- package/src/scripts/hooks/concern_registry.ts +2 -0
- package/src/scripts/hooks/concern_timings.ts +94 -0
- package/src/scripts/hooks/delegation_nudge_hook.ts +1 -2
- package/src/scripts/hooks/design_pass_hook.ts +100 -9
- package/src/scripts/hooks/design_slop_hook.ts +1 -2
- package/src/scripts/hooks/dispatch_hook.ts +77 -71
- package/src/scripts/hooks/edit_shape_hook.ts +1 -2
- package/src/scripts/hooks/end_review_nudge_hook.ts +1 -1
- package/src/scripts/hooks/evidence_independence.ts +1 -2
- package/src/scripts/hooks/exit_codes.ts +129 -0
- package/src/scripts/hooks/host_lowering.json +1 -0
- package/src/scripts/hooks/host_lowering.ts +146 -3
- package/src/scripts/hooks/host_lowering.yaml +262 -46
- package/src/scripts/hooks/host_semantics.ts +30 -2
- package/src/scripts/hooks/injection_budget.ts +9 -2
- package/src/scripts/hooks/interruption_ledger_hook.ts +1 -2
- package/src/scripts/hooks/journal_record_hook.ts +1 -2
- package/src/scripts/hooks/memory_recall_hook.ts +1 -2
- package/src/scripts/hooks/obligation_settle_hook.ts +151 -5
- package/src/scripts/hooks/one_question_per_ask_hook.ts +43 -6
- package/src/scripts/hooks/orchestration_record_hook.ts +1 -2
- package/src/scripts/hooks/payload_stub.ts +10 -1
- package/src/scripts/hooks/permission_gate.ts +1 -2
- package/src/scripts/hooks/push_settle_hook.ts +1 -3
- package/src/scripts/hooks/replay_hook.ts +2 -1
- package/src/scripts/hooks/reread_guard_hook.ts +1 -2
- package/src/scripts/hooks/review_baseline_hook.ts +1 -2
- package/src/scripts/hooks/rtk_wrap_hook.ts +1 -2
- package/src/scripts/hooks/rule_inject_hook.ts +765 -68
- package/src/scripts/hooks/run_continuation_hook.ts +13 -15
- package/src/scripts/hooks/skill_route_hook.ts +1 -2
- package/src/scripts/hooks/source_first_gate_hook.ts +1 -2
- package/src/scripts/hooks/spawn_guard_shadow_hook.ts +1 -2
- package/src/scripts/hooks/subagent_ledger_hook.ts +1 -2
- package/src/scripts/hooks/suggestion_capture_hook.ts +1 -1
- package/src/scripts/hooks/table_fingerprint.ts +70 -0
- package/src/scripts/hooks/telemetry_flush_hook.ts +1 -2
- package/src/scripts/hooks/telemetry_usage_hook.ts +65 -10
- package/src/scripts/hooks/tool_result_bytes_hook.ts +93 -9
- package/src/scripts/hooks/turn_end_gate_hook.ts +421 -324
- package/src/scripts/hooks/ui_route_nudge_hook.ts +1 -2
- package/src/scripts/hooks_status.ts +112 -0
- package/src/scripts/injection_scan_hook.ts +7 -0
- package/src/scripts/install.ts +75 -189
- package/src/scripts/installed_layer_report.ts +103 -0
- package/src/scripts/language_mirror_hook.ts +15 -6
- package/src/scripts/learning_sidecar.ts +119 -8
- package/src/scripts/lint_deny_text.ts +419 -0
- package/src/scripts/lint_exit_codes.ts +262 -0
- package/src/scripts/lint_hook_manifest.ts +108 -0
- package/src/scripts/lint_major_migration_sections.ts +156 -26
- package/src/scripts/lint_pack_boundaries.ts +63 -5
- package/src/scripts/lint_roadmap_blockers.ts +78 -12
- package/src/scripts/lint_rule_law_section.ts +517 -0
- package/src/scripts/lint_skill_descriptions.ts +1 -1
- package/src/scripts/lint_skill_scripts_readonly.ts +1 -1
- package/src/scripts/lint_workflow_security.ts +161 -5
- package/src/scripts/mcp_server/consumer_tool_catalog.json +53 -0
- package/src/scripts/mcp_server/graph_tools.ts +72 -3
- package/src/scripts/mcp_server/prompts.ts +142 -1
- package/src/scripts/measure_routing_signal.ts +54 -16
- package/src/scripts/measure_skill_ranker_baseline.ts +515 -53
- package/src/scripts/measure_turn_end_gate.ts +193 -0
- package/src/scripts/memory_learn_hook.ts +91 -6
- package/src/scripts/memory_lookup.ts +1 -1
- package/src/scripts/model_rule_injection.ts +52 -5
- package/src/scripts/prepack-check.mjs +53 -0
- package/src/scripts/project_thin_rules.ts +34 -327
- package/src/scripts/release_publication.ts +13 -1
- package/src/scripts/report_evidence_temperature.ts +657 -0
- package/src/scripts/report_installed_rule_links.ts +157 -0
- package/src/scripts/report_invocation_surface.ts +383 -0
- package/src/scripts/report_label_agreement.ts +233 -0
- package/src/scripts/report_obligation_carriers.ts +699 -0
- package/src/scripts/report_obligation_mechanism.ts +230 -0
- package/src/scripts/report_obligation_writer_split.ts +236 -0
- package/src/scripts/report_single_token_triggers.ts +277 -0
- package/src/scripts/report_skill_menu_census.ts +208 -0
- package/src/scripts/report_skill_ranker_confusion.ts +442 -0
- package/src/scripts/report_standing_payload_by_host.ts +188 -15
- package/src/scripts/report_verification_record_coverage.ts +306 -0
- package/src/scripts/roadmap_verify_share.ts +213 -0
- package/src/scripts/rule_activation_census.ts +5 -2
- package/src/scripts/rule_trigger_eval.ts +9 -9
- package/src/scripts/schemas/command.schema.json +44 -0
- package/src/scripts/schemas/review-findings.schema.json +7 -2
- package/src/scripts/schemas/rule.schema.json +5 -0
- package/src/scripts/schemas/skill.schema.json +44 -0
- package/src/scripts/self_review_gate.ts +421 -17
- package/src/scripts/semantic_parity_census.ts +314 -0
- package/src/scripts/session_eol_report.ts +54 -1
- package/src/scripts/skill_tools/score_skill_relevance.ts +290 -25
- package/src/scripts/sweep_dead_scan_roots.ts +1 -1
- package/src/scripts/sweep_skill_ranker_signals.ts +129 -0
- package/src/scripts/sync_gitignore.ts +29 -235
- package/src/scripts/trigger_eval_grandfather.json +0 -7
- package/src/scripts/trigger_eval_rotation.ts +122 -27
- package/src/scripts/ui_conformance_probe.ts +156 -4
- package/src/scripts/update_prices.ts +85 -3
- package/src/scripts/write_bundle_digest.mjs +74 -0
- package/src/server/schemas/settings.ts +41 -0
- package/src/shared/skillRanking.ts +117 -11
- package/src/templates/consumer-settings/ONBOARDING.md +1 -0
- package/dist/cli-delegate/chunk-FXYUYU4N.js +0 -4416
- package/dist/cli-delegate/chunk-QJWAUMJW.js +0 -1072
- package/dist/cli-delegate/chunk-YDPILCOL.js +0 -152
- package/dist/ui/assets/index-DH1xc62v.js +0 -29
- package/dist/ui/assets/index-jSfMW8_t.css +0 -1
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
* rejection, or change recording. Apply validates the output against the
|
|
11
11
|
* brief's microcopy lock so a mid-loop hallucination is caught at the boundary.
|
|
12
12
|
*/
|
|
13
|
+
import * as fs from 'node:fs';
|
|
14
|
+
import * as path from 'node:path';
|
|
15
|
+
|
|
13
16
|
import {
|
|
14
17
|
type Any,
|
|
15
18
|
type DeliveryState,
|
|
@@ -17,6 +20,11 @@ import {
|
|
|
17
20
|
StepResult,
|
|
18
21
|
agent_directive,
|
|
19
22
|
} from '../../delivery_state.js';
|
|
23
|
+
import {
|
|
24
|
+
type ComponentRequest,
|
|
25
|
+
conformance_lines,
|
|
26
|
+
plan_component_placement,
|
|
27
|
+
} from '../../taxonomy/place.js';
|
|
20
28
|
import { has_design_system, placeholder_paths, provided_artifact } from './design.js';
|
|
21
29
|
import { _playbook_lines, _scaffold_playbooks } from './scaffold.js';
|
|
22
30
|
import {
|
|
@@ -118,15 +126,26 @@ export function run(state: DeliveryState): StepResult {
|
|
|
118
126
|
}
|
|
119
127
|
|
|
120
128
|
const provided = provided_artifact(state.ui_design as Record<string, Any> | null);
|
|
129
|
+
const notes: string[] = [];
|
|
121
130
|
if (provided !== null) {
|
|
122
|
-
const
|
|
123
|
-
if (gaps.length > 0) {
|
|
124
|
-
return _halt_coverage(state, provided, gaps);
|
|
131
|
+
const report = coverage_report(provided, envelope['coverage']);
|
|
132
|
+
if (report.gaps.length > 0) {
|
|
133
|
+
return _halt_coverage(state, provided, report.gaps);
|
|
134
|
+
}
|
|
135
|
+
notes.push(...report.fallbacks);
|
|
136
|
+
// 3.2 — the shadow is now the outcome. 3.1 shipped the line one
|
|
137
|
+
// release ahead (16.2.0 carries it) so a caller branching on
|
|
138
|
+
// `SUCCESS` was found by the words before it is found by the value.
|
|
139
|
+
if (carried_nothing(report)) {
|
|
140
|
+
return _halt_carried_nothing(state, report, notes);
|
|
125
141
|
}
|
|
126
142
|
}
|
|
127
143
|
|
|
128
144
|
_record_changes(state, envelope);
|
|
129
|
-
return new StepResult({
|
|
145
|
+
return new StepResult({
|
|
146
|
+
outcome: Outcome.SUCCESS,
|
|
147
|
+
message: notes.join('\n'),
|
|
148
|
+
});
|
|
130
149
|
}
|
|
131
150
|
|
|
132
151
|
/** Buckets the coverage report must sort every declared item into. */
|
|
@@ -139,8 +158,73 @@ export const COVERED_INVENTORIES: ReadonlyArray<string> = [
|
|
|
139
158
|
'assets',
|
|
140
159
|
];
|
|
141
160
|
|
|
161
|
+
/** What the coverage report said, split into what halts and what only warns. */
|
|
162
|
+
export interface CoverageReport {
|
|
163
|
+
/** Reasons the report fails to account for the artifact. A halt. */
|
|
164
|
+
gaps: string[];
|
|
165
|
+
/** Items carried only by the deprecated containment fallback. A warning. */
|
|
166
|
+
fallbacks: string[];
|
|
167
|
+
/** Every declared item, in report order. */
|
|
168
|
+
declared: string[];
|
|
169
|
+
/** Declared items whose only account is in `flagged` — work handed back. */
|
|
170
|
+
handed_back: string[];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Did the port hand back everything it was given?
|
|
175
|
+
*
|
|
176
|
+
* True only when there is a declared inventory and **every** item in it is
|
|
177
|
+
* accounted for solely by `flagged`. Deliberately narrow: flagging one dropped
|
|
178
|
+
* handler is the ledger working exactly as designed, and reporting that as a
|
|
179
|
+
* hand-back would make the signal worthless within a week. What this catches
|
|
180
|
+
* is the envelope that accounted for everything and carried none of it — which
|
|
181
|
+
* `coverage_gaps` cannot see, because a complete report and a complete
|
|
182
|
+
* surrender are the same empty gap list.
|
|
183
|
+
*/
|
|
184
|
+
export function carried_nothing(report: CoverageReport): boolean {
|
|
185
|
+
return report.declared.length > 0 && report.handed_back.length === report.declared.length;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** The line that says a port handed its work back, or `null`. */
|
|
189
|
+
function _handed_back_line(report: CoverageReport): string | null {
|
|
190
|
+
if (!carried_nothing(report)) return null;
|
|
191
|
+
return (
|
|
192
|
+
`the port carried nothing over — all ${report.declared.length} declared ` +
|
|
193
|
+
`item(s) are in \`flagged\`: ${report.handed_back.join(', ')}`
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** Characters that make a containment hit part of a longer word. */
|
|
198
|
+
function _is_word_char(ch: string): boolean {
|
|
199
|
+
return (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Does `entry` mention `needle` as its own token rather than by accident?
|
|
204
|
+
*
|
|
205
|
+
* The deprecated fallback's boundary. Both arguments are already lower-cased.
|
|
206
|
+
* `submit handler — translated` mentions `submit handler`; `table sort order`
|
|
207
|
+
* does not mention `tab`, even though it contains those three letters. The
|
|
208
|
+
* discriminator is whether the hit is delimited on both sides, which is
|
|
209
|
+
* exactly the difference between an entry carrying its own explanation — the
|
|
210
|
+
* one thing containment was documented as buying — and a short name colliding
|
|
211
|
+
* with the inside of a longer word.
|
|
212
|
+
*/
|
|
213
|
+
function _mentions(entry: string, needle: string): boolean {
|
|
214
|
+
let from = 0;
|
|
215
|
+
for (;;) {
|
|
216
|
+
const at = entry.indexOf(needle, from);
|
|
217
|
+
if (at < 0) return false;
|
|
218
|
+
const before = at === 0 ? '' : (entry[at - 1] as string);
|
|
219
|
+
const after_at = at + needle.length;
|
|
220
|
+
const after = after_at >= entry.length ? '' : (entry[after_at] as string);
|
|
221
|
+
if (!_is_word_char(before) && !_is_word_char(after)) return true;
|
|
222
|
+
from = at + 1;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
142
226
|
/**
|
|
143
|
-
* Return
|
|
227
|
+
* Return what the coverage report fails to account for, and what it only warns on.
|
|
144
228
|
*
|
|
145
229
|
* The fidelity ledger the port case never had. `apply` used to validate its
|
|
146
230
|
* output with a single placeholder substring scan and nothing else, so a
|
|
@@ -149,22 +233,45 @@ export const COVERED_INVENTORIES: ReadonlyArray<string> = [
|
|
|
149
233
|
* appear in exactly one bucket turns that silence into a halt: a handler the
|
|
150
234
|
* port could not carry has to be written down in `flagged`.
|
|
151
235
|
*
|
|
152
|
-
* Matching is
|
|
153
|
-
*
|
|
154
|
-
* action") and still
|
|
236
|
+
* **Matching is equality, not containment.** Containment was chosen so an
|
|
237
|
+
* entry could carry its own explanation ("submit handler — translated to a
|
|
238
|
+
* form action") and still account for `submit handler`. It also accounted for
|
|
239
|
+
* a declared `tab` with an entry about `table sort order`, which is the same
|
|
240
|
+
* rule doing the opposite of its job: the shorter the declared name, the more
|
|
241
|
+
* likely some unrelated entry contains it, so the gate grew weakest exactly
|
|
242
|
+
* where the inventory was tersest.
|
|
243
|
+
*
|
|
244
|
+
* `allow_annotated_fallback` keeps the explanation case working for one
|
|
245
|
+
* release, as a **warning** rather than a silent pass, so an envelope written
|
|
246
|
+
* against the old rule does not halt without notice. It is narrower than the
|
|
247
|
+
* containment it replaces: the mention has to be delimited
|
|
248
|
+
* ({@link _mentions}), which is the property the explanation case always had
|
|
249
|
+
* and the collision case never did.
|
|
155
250
|
*/
|
|
156
|
-
export function
|
|
251
|
+
export function coverage_report(
|
|
157
252
|
provided: Record<string, Any>,
|
|
158
253
|
coverage: Any,
|
|
159
|
-
|
|
254
|
+
allow_annotated_fallback = true,
|
|
255
|
+
): CoverageReport {
|
|
160
256
|
const gaps: string[] = [];
|
|
257
|
+
const fallbacks: string[] = [];
|
|
258
|
+
const declared_all: string[] = [];
|
|
259
|
+
const handed_back: string[] = [];
|
|
161
260
|
if (!_isDict(coverage)) {
|
|
162
|
-
return
|
|
163
|
-
|
|
164
|
-
'
|
|
165
|
-
|
|
261
|
+
return {
|
|
262
|
+
gaps: [
|
|
263
|
+
'no `coverage` report in the apply envelope — a provided artifact ' +
|
|
264
|
+
'requires one',
|
|
265
|
+
],
|
|
266
|
+
fallbacks,
|
|
267
|
+
declared: declared_all,
|
|
268
|
+
handed_back,
|
|
269
|
+
};
|
|
166
270
|
}
|
|
167
|
-
|
|
271
|
+
// Kept per-bucket, not flattened: which bucket accounted for an item is
|
|
272
|
+
// what separates a port that translated its work from one that handed it
|
|
273
|
+
// back, and a flat list of entries cannot answer that.
|
|
274
|
+
const by_bucket = new Map<string, string[]>();
|
|
168
275
|
for (const bucket of COVERAGE_BUCKETS) {
|
|
169
276
|
const value = coverage[bucket];
|
|
170
277
|
if (value === undefined) {
|
|
@@ -175,26 +282,75 @@ export function coverage_gaps(
|
|
|
175
282
|
gaps.push(`\`coverage.${bucket}\` must be a list of strings`);
|
|
176
283
|
continue;
|
|
177
284
|
}
|
|
285
|
+
const kept: string[] = [];
|
|
178
286
|
for (const item of value) {
|
|
179
287
|
if (typeof item === 'string' && item !== '') {
|
|
180
|
-
|
|
288
|
+
kept.push(item.toLowerCase());
|
|
181
289
|
}
|
|
182
290
|
}
|
|
291
|
+
by_bucket.set(bucket, kept);
|
|
292
|
+
}
|
|
293
|
+
/** The buckets that account for `needle`, by either rule. */
|
|
294
|
+
function _accounting_buckets(needle: string): string[] {
|
|
295
|
+
const hit: string[] = [];
|
|
296
|
+
for (const [bucket, entries] of by_bucket) {
|
|
297
|
+
if (entries.some((entry) => entry === needle)) {
|
|
298
|
+
hit.push(bucket);
|
|
299
|
+
} else if (
|
|
300
|
+
allow_annotated_fallback &&
|
|
301
|
+
entries.some((entry) => _mentions(entry, needle))
|
|
302
|
+
) {
|
|
303
|
+
hit.push(bucket);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return hit;
|
|
183
307
|
}
|
|
184
308
|
for (const inventory of COVERED_INVENTORIES) {
|
|
185
309
|
const declared = provided[inventory];
|
|
186
310
|
if (!Array.isArray(declared)) continue;
|
|
187
311
|
for (const item of declared) {
|
|
188
312
|
if (typeof item !== 'string' || item === '') continue;
|
|
313
|
+
declared_all.push(item);
|
|
189
314
|
const needle = item.toLowerCase();
|
|
190
|
-
|
|
315
|
+
const buckets = _accounting_buckets(needle);
|
|
316
|
+
if (buckets.length === 0) {
|
|
191
317
|
gaps.push(
|
|
192
318
|
`\`${inventory}\`: \`${item}\` appears in no coverage bucket`,
|
|
193
319
|
);
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
if (buckets.length === 1 && buckets[0] === 'flagged') {
|
|
323
|
+
handed_back.push(item);
|
|
324
|
+
}
|
|
325
|
+
const exact = [...by_bucket.values()].some((entries) =>
|
|
326
|
+
entries.some((entry) => entry === needle),
|
|
327
|
+
);
|
|
328
|
+
if (exact) continue;
|
|
329
|
+
const mention = [...by_bucket.values()]
|
|
330
|
+
.flat()
|
|
331
|
+
.find((entry) => _mentions(entry, needle));
|
|
332
|
+
if (mention !== undefined) {
|
|
333
|
+
fallbacks.push(
|
|
334
|
+
`\`${inventory}\`: \`${item}\` matched only by containment ` +
|
|
335
|
+
`against \`${mention}\``,
|
|
336
|
+
);
|
|
194
337
|
}
|
|
195
338
|
}
|
|
196
339
|
}
|
|
197
|
-
return gaps;
|
|
340
|
+
return { gaps, fallbacks, declared: declared_all, handed_back };
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Every reason the coverage report fails to account for the artifact.
|
|
345
|
+
*
|
|
346
|
+
* The halting half of {@link coverage_report}, kept as its own name because
|
|
347
|
+
* that is what callers and the port tests already ask for.
|
|
348
|
+
*/
|
|
349
|
+
export function coverage_gaps(
|
|
350
|
+
provided: Record<string, Any>,
|
|
351
|
+
coverage: Any,
|
|
352
|
+
): string[] {
|
|
353
|
+
return coverage_report(provided, coverage).gaps;
|
|
198
354
|
}
|
|
199
355
|
|
|
200
356
|
/** BLOCKED halt — the port did not account for what the artifact declared. */
|
|
@@ -233,6 +389,49 @@ function _halt_coverage(
|
|
|
233
389
|
});
|
|
234
390
|
}
|
|
235
391
|
|
|
392
|
+
/**
|
|
393
|
+
* BLOCKED halt — the port accounted for everything and carried none of it.
|
|
394
|
+
*
|
|
395
|
+
* The gap list is empty here by construction: a complete report and a complete
|
|
396
|
+
* surrender look identical to `coverage_gaps`, which is why this is its own
|
|
397
|
+
* halt rather than a gap. `questions` is non-empty because the dispatcher
|
|
398
|
+
* rejects a `BLOCKED` result that surfaces nothing to answer — handing the
|
|
399
|
+
* work back has to come with a way forward, not just a refusal.
|
|
400
|
+
*/
|
|
401
|
+
function _halt_carried_nothing(
|
|
402
|
+
state: DeliveryState,
|
|
403
|
+
report: CoverageReport,
|
|
404
|
+
fallbacks: ReadonlyArray<string>,
|
|
405
|
+
): StepResult {
|
|
406
|
+
const directive = _resolve_directive(state);
|
|
407
|
+
const lines: string[] = [
|
|
408
|
+
agent_directive(directive),
|
|
409
|
+
'> Apply rejected: the coverage report accounts for every declared ' +
|
|
410
|
+
'item and the port carried none of them over.',
|
|
411
|
+
`> All ${report.declared.length} declared item(s) are in \`flagged\`:`,
|
|
412
|
+
];
|
|
413
|
+
for (const item of report.handed_back) {
|
|
414
|
+
lines.push(`> - \`${item}\``);
|
|
415
|
+
}
|
|
416
|
+
lines.push(
|
|
417
|
+
'> A complete report and a complete hand-back are the same empty gap ' +
|
|
418
|
+
'list, so this is checked separately — flagging one handler the ' +
|
|
419
|
+
'port could not carry is the ledger working; flagging all of them ' +
|
|
420
|
+
'is the port not having run.',
|
|
421
|
+
'> 1. Continue — implement the items above and re-write ' +
|
|
422
|
+
'`ui_apply.coverage` with each one in `honoured` or `translated`, ' +
|
|
423
|
+
'leaving in `flagged` only what genuinely could not be carried',
|
|
424
|
+
'> 2. Flag deliberately — say here which of the items above are out of ' +
|
|
425
|
+
'scope for this port and why, and the operator decides',
|
|
426
|
+
'> 3. Abort — drop this UI request',
|
|
427
|
+
);
|
|
428
|
+
return new StepResult({
|
|
429
|
+
outcome: Outcome.BLOCKED,
|
|
430
|
+
questions: lines,
|
|
431
|
+
message: [...fallbacks, `UI apply rejected: ${_handed_back_line(report)}`].join('\n'),
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
|
|
236
435
|
/** Return the agent-written `ui_apply` envelope, or `null`. */
|
|
237
436
|
function _apply_envelope(state: DeliveryState): Record<string, Any> | null {
|
|
238
437
|
const data = _pyTruthy(state.ticket) ? state.ticket : {};
|
|
@@ -243,6 +442,40 @@ function _apply_envelope(state: DeliveryState): Record<string, Any> | null {
|
|
|
243
442
|
return null;
|
|
244
443
|
}
|
|
245
444
|
|
|
445
|
+
/**
|
|
446
|
+
* Conformance lines for the taxonomy the audit detected, or nothing.
|
|
447
|
+
*
|
|
448
|
+
* Empty whenever `state.ui_audit.component_taxonomy` is absent or names no
|
|
449
|
+
* tiers — which is every project that has not chosen a granularity taxonomy,
|
|
450
|
+
* and is the case whose output must stay exactly as it was. Holding to the
|
|
451
|
+
* project's own structures is the standing rule; this step only ever conforms
|
|
452
|
+
* to a taxonomy the project itself evidences.
|
|
453
|
+
*
|
|
454
|
+
* The `'none'` case is NOT re-checked here. `conformance_lines` owns that
|
|
455
|
+
* invariant and says so in its own contract, and a second copy of the check
|
|
456
|
+
* here would mask a regression in the first: with both present, either one
|
|
457
|
+
* could be deleted and every AC-2 test would still pass. One owner, one test
|
|
458
|
+
* that fails when it breaks.
|
|
459
|
+
*/
|
|
460
|
+
export function taxonomy_lines(state: DeliveryState): string[] {
|
|
461
|
+
const audit = _isDict(state.ui_audit) ? (state.ui_audit as Record<string, Any>) : {};
|
|
462
|
+
const taxonomy = audit['component_taxonomy'];
|
|
463
|
+
if (typeof taxonomy !== 'string' || taxonomy === '') {
|
|
464
|
+
return [];
|
|
465
|
+
}
|
|
466
|
+
const root = typeof audit['component_root'] === 'string' ? audit['component_root'] : '';
|
|
467
|
+
const design = _isDict(state.ui_design) ? (state.ui_design as Record<string, Any>) : {};
|
|
468
|
+
const raw = design['components'];
|
|
469
|
+
const components: ComponentRequest[] = Array.isArray(raw)
|
|
470
|
+
? raw.filter((c): c is Record<string, Any> => _isDict(c))
|
|
471
|
+
: [];
|
|
472
|
+
return conformance_lines(
|
|
473
|
+
taxonomy,
|
|
474
|
+
root,
|
|
475
|
+
plan_component_placement(taxonomy, root, components),
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
|
|
246
479
|
/** Pick the agent directive for the project's frontend stack. */
|
|
247
480
|
function _resolve_directive(state: DeliveryState): string {
|
|
248
481
|
const stack = _pyTruthy(state.stack) ? state.stack : {};
|
|
@@ -265,7 +498,53 @@ function _resolve_directive(state: DeliveryState): string {
|
|
|
265
498
|
* exactly the same inputs.
|
|
266
499
|
*/
|
|
267
500
|
function _placeholder_violations_in_output(envelope: Record<string, Any>): string[] {
|
|
268
|
-
return placeholder_paths(envelope['rendered']);
|
|
501
|
+
return [...placeholder_paths(envelope['rendered']), ...written_file_placeholders(envelope)];
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Return the written files whose text carries a placeholder pattern.
|
|
506
|
+
*
|
|
507
|
+
* `rendered` is the porter's own report of what it wrote. The files are what
|
|
508
|
+
* it actually wrote, and nothing made the two agree — a placeholder that never
|
|
509
|
+
* entered the report was invisible to a gate that only read the report. This
|
|
510
|
+
* reads the other side of that pair.
|
|
511
|
+
*
|
|
512
|
+
* **Only `envelope['files']`** — the set the port declares it changed. Never a
|
|
513
|
+
* tree sweep: the directive has no business reading files this run did not
|
|
514
|
+
* touch, and a sweep would grow with the repository rather than with the port.
|
|
515
|
+
*
|
|
516
|
+
* A path that does not resolve to a readable file is **skipped, not reported**.
|
|
517
|
+
* `apply` runs at points where a declared file may not be on disk yet, and
|
|
518
|
+
* halting a correct port because a path failed to resolve would be a worse
|
|
519
|
+
* failure than the one this closes. The cost is real and worth naming: a
|
|
520
|
+
* placeholder inside a file the engine cannot read stays unseen.
|
|
521
|
+
*
|
|
522
|
+
* `root` defaults to the working directory, which is the consumer project root
|
|
523
|
+
* when the engine runs — the same convention as `scaffold`'s token lookup.
|
|
524
|
+
*/
|
|
525
|
+
export function written_file_placeholders(
|
|
526
|
+
envelope: Record<string, Any>,
|
|
527
|
+
root: string | null = null,
|
|
528
|
+
): string[] {
|
|
529
|
+
const files = envelope['files'];
|
|
530
|
+
if (!Array.isArray(files)) return [];
|
|
531
|
+
const base = root !== null ? root : process.cwd();
|
|
532
|
+
const hits: string[] = [];
|
|
533
|
+
for (const rel of files as Any[]) {
|
|
534
|
+
if (typeof rel !== 'string' || rel === '') continue;
|
|
535
|
+
let text: string;
|
|
536
|
+
try {
|
|
537
|
+
const full = path.resolve(base, rel);
|
|
538
|
+
if (!fs.statSync(full).isFile()) continue;
|
|
539
|
+
text = fs.readFileSync(full, 'utf8');
|
|
540
|
+
} catch {
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
if (placeholder_paths(text, rel).length > 0) {
|
|
544
|
+
hits.push(rel);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
return hits;
|
|
269
548
|
}
|
|
270
549
|
|
|
271
550
|
/** First-pass halt — emit the stack-specific apply directive. */
|
|
@@ -298,6 +577,7 @@ function _delegate_to_stack_skill(state: DeliveryState): StepResult {
|
|
|
298
577
|
'> Microcopy is locked — every button label, empty-state ' +
|
|
299
578
|
'message, and validation message must come verbatim from ' +
|
|
300
579
|
'`state.ui_design.microcopy`.',
|
|
580
|
+
...taxonomy_lines(state),
|
|
301
581
|
];
|
|
302
582
|
if (provided !== null) {
|
|
303
583
|
lines.push(
|
|
@@ -331,9 +611,10 @@ function _halt_placeholders(state: DeliveryState, violations: string[]): StepRes
|
|
|
331
611
|
const directive = _resolve_directive(state);
|
|
332
612
|
const lines: string[] = [
|
|
333
613
|
agent_directive(directive),
|
|
334
|
-
'> Apply rejected:
|
|
614
|
+
'> Apply rejected: the port output contains placeholder strings. ' +
|
|
335
615
|
'The design-brief microcopy lock failed mid-loop.',
|
|
336
|
-
'> Affected paths in `ui_apply.rendered
|
|
616
|
+
'> Affected paths, in `ui_apply.rendered` and in the files the ' +
|
|
617
|
+
'envelope declares it wrote:',
|
|
337
618
|
];
|
|
338
619
|
for (const p of violations) {
|
|
339
620
|
lines.push(`> - \`${p}\``);
|
|
@@ -19,6 +19,20 @@ import {
|
|
|
19
19
|
agent_directive,
|
|
20
20
|
} from '../../delivery_state.js';
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* The greenfield pick that adopts a component-granularity convention.
|
|
24
|
+
*
|
|
25
|
+
* Re-exported from the schema, which owns it beside `GREENFIELD_DECISIONS` —
|
|
26
|
+
* an option the user can pick that the schema then rejects is a halt with a
|
|
27
|
+
* dead exit, so the two cannot be allowed to drift.
|
|
28
|
+
*
|
|
29
|
+
* Offered only here, and only as an OFFER: a project that already exists is
|
|
30
|
+
* never asked, and a user who picks any other number has declined it for good
|
|
31
|
+
* — the halt is a no-op once a decision is recorded, so declining costs one
|
|
32
|
+
* number and is never raised again.
|
|
33
|
+
*/
|
|
34
|
+
export { GRANULARITY_CONVENTION } from '../../state.js';
|
|
35
|
+
|
|
22
36
|
/** Similarity threshold for a "strong reusable match". */
|
|
23
37
|
export const STRONG_SIMILARITY = 0.7;
|
|
24
38
|
|
|
@@ -42,8 +56,9 @@ export const AMBIGUITIES: ReadonlyArray<Record<string, string>> = [
|
|
|
42
56
|
'state.ui_audit.greenfield is True but greenfield_decision ' +
|
|
43
57
|
'is unset — user has not picked a scaffolding direction',
|
|
44
58
|
resolution:
|
|
45
|
-
'user picks scaffold / bare / external_reference
|
|
46
|
-
'agent records the choice in
|
|
59
|
+
'user picks scaffold / bare / external_reference / ' +
|
|
60
|
+
'granularity_convention; agent records the choice in ' +
|
|
61
|
+
'state.ui_audit.greenfield_decision',
|
|
47
62
|
},
|
|
48
63
|
{
|
|
49
64
|
code: 'shadcn_version_mismatch',
|
|
@@ -198,6 +213,9 @@ function _halt_greenfield(state: DeliveryState, audit: Record<string, Any>): Ste
|
|
|
198
213
|
'> 1. Scaffold — minimal token set + base component primitive folder',
|
|
199
214
|
'> 2. Bare — proceed with Tailwind defaults, no scaffolding',
|
|
200
215
|
'> 3. External reference — point me at a design-system URL or file',
|
|
216
|
+
'> 4. Scaffold + a granularity convention — as 1, and new components ' +
|
|
217
|
+
'go into named granularity folders you pick the names for; ' +
|
|
218
|
+
'rename or drop it later and nothing here objects',
|
|
201
219
|
'',
|
|
202
220
|
'**Recommendation: 1 — Scaffold tokens + primitives** ' +
|
|
203
221
|
'— even one extra screen benefits from a shared base; the ' +
|
|
@@ -210,7 +228,8 @@ function _halt_greenfield(state: DeliveryState, audit: Record<string, Any>): Ste
|
|
|
210
228
|
questions,
|
|
211
229
|
message:
|
|
212
230
|
'UI audit detected greenfield; halting for scaffolding ' +
|
|
213
|
-
'direction (scaffold / bare / external_reference
|
|
231
|
+
'direction (scaffold / bare / external_reference / ' +
|
|
232
|
+
'granularity_convention).',
|
|
214
233
|
});
|
|
215
234
|
}
|
|
216
235
|
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
StepResult,
|
|
43
43
|
agent_directive,
|
|
44
44
|
} from '../../delivery_state.js';
|
|
45
|
+
import { GRANULARITY_CONVENTION } from '../../state.js';
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
48
|
* Conventional locations for a project's DTCG `tokens.json`.
|
|
@@ -307,9 +308,13 @@ export function run(state: DeliveryState): StepResult {
|
|
|
307
308
|
function _is_greenfield_scaffold(state: DeliveryState): boolean {
|
|
308
309
|
const audit = state.ui_audit;
|
|
309
310
|
if (!_isDict(audit)) return false;
|
|
311
|
+
// `granularity_convention` is option 4 — a scaffold that additionally
|
|
312
|
+
// organises what it creates under a named convention. It has to reach the
|
|
313
|
+
// scaffold gate, or picking 4 would scaffold nothing at all.
|
|
310
314
|
return (
|
|
311
315
|
audit['greenfield'] === true &&
|
|
312
|
-
audit['greenfield_decision'] === 'scaffold'
|
|
316
|
+
(audit['greenfield_decision'] === 'scaffold' ||
|
|
317
|
+
audit['greenfield_decision'] === GRANULARITY_CONVENTION)
|
|
313
318
|
);
|
|
314
319
|
}
|
|
315
320
|
|