oxe-cc 1.21.1 → 1.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/commands/oxe-alm.md +47 -0
- package/.cursor/commands/oxe-ask.md +1 -1
- package/.cursor/commands/oxe-capabilities.md +1 -1
- package/.cursor/commands/oxe-checkpoint.md +1 -1
- package/.cursor/commands/oxe-compact.md +1 -1
- package/.cursor/commands/oxe-dashboard.md +1 -1
- package/.cursor/commands/oxe-debug.md +1 -1
- package/.cursor/commands/oxe-discuss.md +1 -1
- package/.cursor/commands/oxe-execute.md +3 -1
- package/.cursor/commands/oxe-forensics.md +1 -1
- package/.cursor/commands/oxe-help.md +1 -1
- package/.cursor/commands/oxe-loop.md +1 -1
- package/.cursor/commands/oxe-milestone.md +1 -1
- package/.cursor/commands/oxe-next.md +1 -1
- package/.cursor/commands/oxe-obs.md +1 -1
- package/.cursor/commands/oxe-plan-agent.md +1 -1
- package/.cursor/commands/oxe-plan.md +3 -1
- package/.cursor/commands/oxe-project.md +1 -1
- package/.cursor/commands/oxe-quick.md +6 -4
- package/.cursor/commands/oxe-research.md +1 -1
- package/.cursor/commands/oxe-retro.md +1 -1
- package/.cursor/commands/oxe-review-pr.md +1 -1
- package/.cursor/commands/oxe-route.md +1 -1
- package/.cursor/commands/oxe-scan.md +1 -1
- package/.cursor/commands/oxe-security.md +1 -1
- package/.cursor/commands/oxe-session.md +1 -1
- package/.cursor/commands/oxe-ship.md +8 -8
- package/.cursor/commands/oxe-skill.md +1 -1
- package/.cursor/commands/oxe-spec.md +5 -3
- package/.cursor/commands/oxe-ui-review.md +1 -1
- package/.cursor/commands/oxe-ui-spec.md +1 -1
- package/.cursor/commands/oxe-update.md +1 -1
- package/.cursor/commands/oxe-validate-gaps.md +1 -1
- package/.cursor/commands/oxe-verify-audit.md +1 -1
- package/.cursor/commands/oxe-verify.md +1 -1
- package/.cursor/commands/oxe-workflow-authoring.md +1 -1
- package/.cursor/commands/oxe-workstream.md +1 -1
- package/.cursor/commands/oxe.md +4 -2
- package/.github/copilot-instructions.md +177 -177
- package/.github/dependabot.yml +31 -31
- package/.github/prompts/oxe-alm.prompt.md +47 -0
- package/.github/prompts/oxe-ask.prompt.md +1 -1
- package/.github/prompts/oxe-capabilities.prompt.md +1 -1
- package/.github/prompts/oxe-checkpoint.prompt.md +1 -1
- package/.github/prompts/oxe-compact.prompt.md +1 -1
- package/.github/prompts/oxe-dashboard.prompt.md +1 -1
- package/.github/prompts/oxe-debug.prompt.md +1 -1
- package/.github/prompts/oxe-discuss.prompt.md +1 -1
- package/.github/prompts/oxe-execute.prompt.md +3 -1
- package/.github/prompts/oxe-forensics.prompt.md +1 -1
- package/.github/prompts/oxe-help.prompt.md +1 -1
- package/.github/prompts/oxe-loop.prompt.md +1 -1
- package/.github/prompts/oxe-milestone.prompt.md +1 -1
- package/.github/prompts/oxe-next.prompt.md +1 -1
- package/.github/prompts/oxe-obs.prompt.md +1 -1
- package/.github/prompts/oxe-plan-agent.prompt.md +1 -1
- package/.github/prompts/oxe-plan.prompt.md +3 -1
- package/.github/prompts/oxe-project.prompt.md +1 -1
- package/.github/prompts/oxe-quick.prompt.md +6 -4
- package/.github/prompts/oxe-research.prompt.md +1 -1
- package/.github/prompts/oxe-retro.prompt.md +1 -1
- package/.github/prompts/oxe-review-pr.prompt.md +1 -1
- package/.github/prompts/oxe-route.prompt.md +1 -1
- package/.github/prompts/oxe-scan.prompt.md +1 -1
- package/.github/prompts/oxe-security.prompt.md +1 -1
- package/.github/prompts/oxe-session.prompt.md +1 -1
- package/.github/prompts/oxe-ship.prompt.md +7 -7
- package/.github/prompts/oxe-skill.prompt.md +1 -1
- package/.github/prompts/oxe-spec.prompt.md +4 -2
- package/.github/prompts/oxe-ui-review.prompt.md +1 -1
- package/.github/prompts/oxe-ui-spec.prompt.md +1 -1
- package/.github/prompts/oxe-update.prompt.md +1 -1
- package/.github/prompts/oxe-validate-gaps.prompt.md +1 -1
- package/.github/prompts/oxe-verify-audit.prompt.md +1 -1
- package/.github/prompts/oxe-verify.prompt.md +1 -1
- package/.github/prompts/oxe-workflow-authoring.prompt.md +1 -1
- package/.github/prompts/oxe-workstream.prompt.md +1 -1
- package/.github/prompts/oxe.prompt.md +4 -2
- package/.github/workflows/ci.yml +163 -163
- package/.github/workflows/release.yml +151 -120
- package/AGENTS.md +108 -102
- package/CHANGELOG.md +1971 -1042
- package/LICENSE +21 -21
- package/QUICKSTART.md +99 -99
- package/README.md +703 -673
- package/bin/banner.txt +18 -18
- package/bin/lib/commands/ops-commands.cjs +751 -0
- package/bin/lib/commands/spec-program-commands.cjs +337 -0
- package/bin/lib/operational/alm-refine-runtime.cjs +791 -0
- package/bin/lib/operational/child-env.cjs +52 -0
- package/bin/lib/operational/promote-runtime.cjs +1187 -0
- package/bin/lib/oxe-acceptance-audit.cjs +195 -0
- package/bin/lib/oxe-adr.cjs +145 -0
- package/bin/lib/oxe-agent-coord.cjs +246 -0
- package/bin/lib/oxe-agent-install.cjs +679 -677
- package/bin/lib/oxe-alm-admin.cjs +215 -0
- package/bin/lib/oxe-alm-metrics.cjs +143 -0
- package/bin/lib/oxe-alm-prs.cjs +274 -0
- package/bin/lib/oxe-alm-refine.cjs +1099 -0
- package/bin/lib/oxe-alm.cjs +1289 -0
- package/bin/lib/oxe-anchor-copy.cjs +218 -0
- package/bin/lib/oxe-api-surface.cjs +96 -0
- package/bin/lib/oxe-artifact-catalog.cjs +376 -376
- package/bin/lib/oxe-artifact-refs.cjs +72 -0
- package/bin/lib/oxe-attention.cjs +97 -0
- package/bin/lib/oxe-autoresume.cjs +448 -0
- package/bin/lib/oxe-budget.cjs +154 -117
- package/bin/lib/oxe-change-folder.cjs +130 -0
- package/bin/lib/oxe-change.cjs +389 -230
- package/bin/lib/oxe-channels.cjs +82 -0
- package/bin/lib/oxe-ci-adapter.cjs +304 -0
- package/bin/lib/oxe-cited-paths.cjs +180 -0
- package/bin/lib/oxe-cli-errors.cjs +76 -0
- package/bin/lib/oxe-cli-output.cjs +111 -0
- package/bin/lib/oxe-command-registry.cjs +31 -31
- package/bin/lib/oxe-commit-convention.cjs +104 -85
- package/bin/lib/oxe-complexity.cjs +106 -0
- package/bin/lib/oxe-console-decode.cjs +23 -0
- package/bin/lib/oxe-context-engine.cjs +874 -874
- package/bin/lib/oxe-coordinator-queue.cjs +67 -0
- package/bin/lib/oxe-core-command-handlers.cjs +84 -82
- package/bin/lib/oxe-criteria-ids.cjs +87 -0
- package/bin/lib/oxe-criterion-coverage.cjs +93 -58
- package/bin/lib/oxe-cross-card-conflicts.cjs +639 -0
- package/bin/lib/oxe-customize.cjs +146 -0
- package/bin/lib/oxe-dashboard.cjs +737 -737
- package/bin/lib/oxe-decisions.cjs +217 -0
- package/bin/lib/oxe-deferred.cjs +80 -0
- package/bin/lib/oxe-deps-audit.cjs +136 -0
- package/bin/lib/oxe-diff-reviewer.cjs +105 -0
- package/bin/lib/oxe-dir-info.cjs +157 -0
- package/bin/lib/oxe-docs-check.cjs +124 -0
- package/bin/lib/oxe-docs-publish.cjs +81 -0
- package/bin/lib/oxe-dom-hooks.cjs +902 -0
- package/bin/lib/oxe-dossier.cjs +355 -281
- package/bin/lib/oxe-e2e-ready.cjs +360 -0
- package/bin/lib/oxe-env-sanitize.cjs +160 -0
- package/bin/lib/oxe-event-bus.cjs +118 -118
- package/bin/lib/oxe-failure-cost.cjs +144 -0
- package/bin/lib/oxe-file-size-guard.cjs +849 -0
- package/bin/lib/oxe-findings.cjs +86 -0
- package/bin/lib/oxe-git-root.cjs +97 -0
- package/bin/lib/oxe-grill-cases.cjs +148 -0
- package/bin/lib/oxe-grill.cjs +533 -0
- package/bin/lib/oxe-grooming.cjs +115 -0
- package/bin/lib/oxe-guard.cjs +180 -0
- package/bin/lib/oxe-handoff.cjs +97 -0
- package/bin/lib/oxe-install-resolve.cjs +134 -134
- package/bin/lib/oxe-integration-checks.cjs +285 -0
- package/bin/lib/oxe-intent-context.cjs +101 -0
- package/bin/lib/oxe-journey.cjs +403 -0
- package/bin/lib/oxe-known-failures.cjs +138 -0
- package/bin/lib/oxe-local-config.cjs +77 -0
- package/bin/lib/oxe-manifest.cjs +124 -124
- package/bin/lib/oxe-memory-kernel.cjs +190 -188
- package/bin/lib/oxe-merge-train.cjs +277 -0
- package/bin/lib/oxe-model-resolve.cjs +74 -0
- package/bin/lib/oxe-model-tiers.cjs +65 -0
- package/bin/lib/oxe-nfr.cjs +125 -0
- package/bin/lib/oxe-npm-version.cjs +66 -66
- package/bin/lib/oxe-onboard.cjs +640 -0
- package/bin/lib/oxe-open-defects.cjs +121 -0
- package/bin/lib/oxe-operational.cjs +12112 -2115
- package/bin/lib/oxe-origin-guard.cjs +102 -0
- package/bin/lib/oxe-origin.cjs +380 -0
- package/bin/lib/oxe-pack-removed.cjs +208 -0
- package/bin/lib/oxe-parallel-run.cjs +81 -0
- package/bin/lib/oxe-parallel.cjs +234 -0
- package/bin/lib/oxe-phase-extras.cjs +185 -0
- package/bin/lib/oxe-phase-gates.cjs +688 -280
- package/bin/lib/oxe-plan-build.cjs +1580 -0
- package/bin/lib/oxe-plan-json.cjs +1107 -433
- package/bin/lib/oxe-plan-merge.cjs +253 -0
- package/bin/lib/oxe-plan-mutate.cjs +320 -0
- package/bin/lib/oxe-plan-repair.cjs +479 -0
- package/bin/lib/oxe-plan-review.cjs +256 -0
- package/bin/lib/oxe-plan-skeleton.cjs +494 -0
- package/bin/lib/oxe-plan-staleness.cjs +125 -0
- package/bin/lib/oxe-plugin-cli.cjs +97 -95
- package/bin/lib/oxe-plugins.cjs +432 -432
- package/bin/lib/oxe-policy-rules.cjs +144 -0
- package/bin/lib/oxe-prd.cjs +129 -0
- package/bin/lib/oxe-preflight.cjs +384 -0
- package/bin/lib/oxe-presets.cjs +216 -0
- package/bin/lib/oxe-process.cjs +67 -67
- package/bin/lib/oxe-program-members.cjs +97 -0
- package/bin/lib/oxe-program.cjs +245 -205
- package/bin/lib/oxe-progress-run.cjs +80 -0
- package/bin/lib/oxe-project-env.cjs +352 -178
- package/bin/lib/oxe-project-health.cjs +3426 -2962
- package/bin/lib/oxe-promote-helpers.cjs +1561 -0
- package/bin/lib/oxe-provider-antigravity.cjs +114 -0
- package/bin/lib/oxe-provider-grok.cjs +48 -0
- package/bin/lib/oxe-questions.cjs +115 -0
- package/bin/lib/oxe-quick.cjs +537 -0
- package/bin/lib/oxe-ratchets.cjs +132 -0
- package/bin/lib/oxe-rationality.cjs +587 -556
- package/bin/lib/oxe-real-regression.cjs +97 -0
- package/bin/lib/oxe-recovery.cjs +160 -0
- package/bin/lib/oxe-reevaluate.cjs +198 -0
- package/bin/lib/oxe-release-ops.cjs +361 -0
- package/bin/lib/oxe-release.cjs +622 -593
- package/bin/lib/oxe-repair.cjs +153 -0
- package/bin/lib/oxe-repo-map.cjs +136 -0
- package/bin/lib/oxe-repo-rules.cjs +121 -108
- package/bin/lib/oxe-research-provenance.cjs +96 -0
- package/bin/lib/oxe-resume.cjs +406 -0
- package/bin/lib/oxe-review.cjs +403 -0
- package/bin/lib/oxe-rfc.cjs +192 -0
- package/bin/lib/oxe-risk-decision.cjs +141 -0
- package/bin/lib/oxe-runtime-semantics.cjs +521 -514
- package/bin/lib/oxe-scorecard.cjs +627 -164
- package/bin/lib/oxe-scratch.cjs +81 -0
- package/bin/lib/oxe-seams.cjs +159 -0
- package/bin/lib/oxe-semver.cjs +83 -0
- package/bin/lib/oxe-ship-pr.cjs +272 -0
- package/bin/lib/oxe-signal.cjs +173 -0
- package/bin/lib/oxe-skill-loader.cjs +131 -131
- package/bin/lib/oxe-spec-check.cjs +249 -0
- package/bin/lib/oxe-spec-ears.cjs +98 -0
- package/bin/lib/oxe-spec-edit.cjs +411 -0
- package/bin/lib/oxe-spec-freeze.cjs +378 -0
- package/bin/lib/oxe-spec-probe.cjs +146 -0
- package/bin/lib/oxe-spec-stress.cjs +146 -0
- package/bin/lib/oxe-spike.cjs +98 -98
- package/bin/lib/oxe-state.cjs +87 -0
- package/bin/lib/oxe-stub-check.cjs +355 -0
- package/bin/lib/oxe-suite-impact.cjs +1160 -0
- package/bin/lib/oxe-sync.cjs +347 -0
- package/bin/lib/oxe-system-design.cjs +138 -0
- package/bin/lib/oxe-task-gates.cjs +139 -0
- package/bin/lib/oxe-telemetry.cjs +201 -0
- package/bin/lib/oxe-test-precheck.cjs +508 -0
- package/bin/lib/oxe-test-rigor.cjs +663 -0
- package/bin/lib/oxe-test-scope.cjs +883 -0
- package/bin/lib/oxe-trace.cjs +168 -0
- package/bin/lib/oxe-turns.cjs +64 -0
- package/bin/lib/oxe-ui-evidence.cjs +187 -0
- package/bin/lib/oxe-ui-verify.cjs +55 -0
- package/bin/lib/oxe-unsafe-commands.cjs +94 -0
- package/bin/lib/oxe-verdicts.cjs +131 -0
- package/bin/lib/oxe-verify-cache.cjs +132 -0
- package/bin/lib/oxe-verify-dryrun.cjs +541 -152
- package/bin/lib/oxe-verify-remote.cjs +208 -0
- package/bin/lib/oxe-vitest-batch.cjs +149 -0
- package/bin/lib/oxe-workflow-budget.cjs +99 -0
- package/bin/lib/oxe-workflow-eval.cjs +118 -0
- package/bin/lib/oxe-workflows.cjs +147 -145
- package/bin/lib/oxe-worktree-deps.cjs +241 -0
- package/bin/lib/oxe-worktree-gc.cjs +655 -0
- package/bin/oxe-cc.js +3861 -100
- package/commands/oxe/alm.md +54 -0
- package/commands/oxe/ask.md +1 -1
- package/commands/oxe/capabilities.md +1 -1
- package/commands/oxe/checkpoint.md +1 -1
- package/commands/oxe/compact.md +1 -1
- package/commands/oxe/dashboard.md +1 -1
- package/commands/oxe/debug.md +1 -1
- package/commands/oxe/discuss.md +1 -1
- package/commands/oxe/execute.md +3 -1
- package/commands/oxe/forensics.md +1 -1
- package/commands/oxe/help.md +1 -1
- package/commands/oxe/loop.md +1 -1
- package/commands/oxe/milestone.md +1 -1
- package/commands/oxe/next.md +1 -1
- package/commands/oxe/obs.md +1 -1
- package/commands/oxe/oxe.md +3 -1
- package/commands/oxe/plan-agent.md +1 -1
- package/commands/oxe/plan.md +3 -1
- package/commands/oxe/project.md +1 -1
- package/commands/oxe/quick.md +4 -4
- package/commands/oxe/research.md +1 -1
- package/commands/oxe/retro.md +1 -1
- package/commands/oxe/review-pr.md +1 -1
- package/commands/oxe/route.md +1 -1
- package/commands/oxe/scan.md +1 -1
- package/commands/oxe/security.md +1 -1
- package/commands/oxe/session.md +1 -1
- package/commands/oxe/ship.md +6 -6
- package/commands/oxe/skill.md +1 -1
- package/commands/oxe/spec.md +6 -3
- package/commands/oxe/ui-review.md +1 -1
- package/commands/oxe/ui-spec.md +1 -1
- package/commands/oxe/update.md +1 -1
- package/commands/oxe/validate-gaps.md +1 -1
- package/commands/oxe/verify-audit.md +1 -1
- package/commands/oxe/verify.md +1 -1
- package/commands/oxe/workflow-authoring.md +1 -1
- package/commands/oxe/workstream.md +1 -1
- package/docs/ADLC-COVERAGE.md +55 -0
- package/docs/CONTENT-MIGRATION-AUDIT.md +49 -49
- package/docs/HAPPY-PATH.md +106 -0
- package/docs/INCIDENT-PLAYBOOK.md +181 -181
- package/docs/INTEGRATION.md +182 -182
- package/docs/QUALITY-GATES.md +46 -46
- package/docs/RELEASE-READINESS.md +93 -87
- package/docs/ROLES.md +129 -129
- package/docs/RUNTIME-SMOKE-MATRIX.md +137 -137
- package/docs/TEAM-ADOPTION.md +153 -153
- package/docs/WALKTHROUGH.md +241 -241
- package/docs/adr/D-1-isolamento-read-only-e-sanitizacao-centralizada-de-env-vars.md +29 -0
- package/docs/adr/D-2-junction-segura-de-node-modules-condicionada-a-sha-256-de-pa.md +29 -0
- package/docs/adr/D-3-preflight-local-5s-impacto-estatico-e2e-e-leitura-explicita.md +29 -0
- package/docs/adr/D-4-governanca-de-release-unificada-retomada-idempotente-pos-rei.md +29 -0
- package/docs/adr/D-5-core-agnostico-vs-presets-declarativos-de-dominio.md +29 -0
- package/docs/adr/D-6-decomposicao-strangler-fig-de-oxe-cc-e-oxe-operational.md +29 -0
- package/docs/adr/D-7-paridade-pre-push-com-phase-gates-path-aware-json-compacto-e.md +28 -0
- package/docs/adr/D-F1F4-1-paridade-pre-push-compactacao-json-sync-version-pins-e-quali.md +44 -0
- package/docs/adr/README.md +19 -0
- package/docs/cli-errors.md +20 -0
- package/docs/oxespace-1.5/BACKLOG.md +2056 -273
- package/docs/oxespace-1.5/HANDOFF-1.21.2.md +140 -0
- package/docs/oxevoice/BACKLOG.md +244 -244
- package/lib/runtime/compiler/graph-compiler.d.ts +2 -0
- package/lib/runtime/compiler/graph-compiler.js +11 -2
- package/lib/runtime/delivery/promotion-pipeline.d.ts +1 -0
- package/lib/runtime/delivery/promotion-pipeline.js +53 -0
- package/lib/runtime/events/catalog.d.ts +1 -1
- package/lib/runtime/events/catalog.js +18 -0
- package/lib/runtime/executor/action-tool-map.d.ts +3 -1
- package/lib/runtime/executor/action-tool-map.js +4 -1
- package/lib/runtime/executor/adapters/antigravity-cli.d.ts +103 -0
- package/lib/runtime/executor/adapters/antigravity-cli.js +530 -0
- package/lib/runtime/executor/adapters/claude-cli.d.ts +29 -0
- package/lib/runtime/executor/adapters/claude-cli.js +92 -14
- package/lib/runtime/executor/adapters/grok-cli.d.ts +89 -0
- package/lib/runtime/executor/adapters/grok-cli.js +351 -0
- package/lib/runtime/executor/adapters/registry.d.ts +6 -1
- package/lib/runtime/executor/adapters/registry.js +22 -2
- package/lib/runtime/executor/adapters/types.d.ts +1 -1
- package/lib/runtime/executor/built-in-tools.d.ts +56 -0
- package/lib/runtime/executor/built-in-tools.js +219 -17
- package/lib/runtime/executor/index.d.ts +9 -2
- package/lib/runtime/executor/index.js +23 -1
- package/lib/runtime/executor/llm-task-executor.d.ts +76 -3
- package/lib/runtime/executor/llm-task-executor.js +514 -31
- package/lib/runtime/executor/node-context.d.ts +11 -0
- package/lib/runtime/executor/node-context.js +10 -0
- package/lib/runtime/executor/node-prompt-builder.js +2 -0
- package/lib/runtime/executor/quota-patterns.d.ts +7 -0
- package/lib/runtime/executor/quota-patterns.js +39 -0
- package/lib/runtime/executor/shell-argv.d.ts +11 -0
- package/lib/runtime/executor/shell-argv.js +89 -2
- package/lib/runtime/executor/stream-completion.d.ts +16 -0
- package/lib/runtime/executor/stream-completion.js +72 -4
- package/lib/runtime/index.d.ts +1 -1
- package/lib/runtime/index.js +3 -1
- package/lib/runtime/models/failure.d.ts +1 -1
- package/lib/runtime/models/run.d.ts +1 -1
- package/lib/runtime/program/program-model.d.ts +20 -2
- package/lib/runtime/program/program-model.js +73 -6
- package/lib/runtime/projection/projection-engine.d.ts +6 -0
- package/lib/runtime/projection/projection-engine.js +30 -2
- package/lib/runtime/reducers/run-state-reducer.js +43 -5
- package/lib/runtime/scheduler/run-journal.d.ts +8 -0
- package/lib/runtime/scheduler/scheduler.d.ts +211 -2
- package/lib/runtime/scheduler/scheduler.js +982 -98
- package/lib/runtime/verification/runner-timeout.d.ts +7 -0
- package/lib/runtime/verification/runner-timeout.js +17 -0
- package/lib/runtime/verification/test-report-parsers.d.ts +2 -1
- package/lib/runtime/verification/test-report-parsers.js +9 -1
- package/lib/runtime/verification/verification-compiler.d.ts +46 -2
- package/lib/runtime/verification/verification-compiler.js +335 -33
- package/lib/runtime/verification/verification-manifest.d.ts +2 -0
- package/lib/runtime/verification/verification-manifest.js +15 -1
- package/lib/runtime/workspace/index.d.ts +2 -1
- package/lib/runtime/workspace/index.js +3 -1
- package/lib/runtime/workspace/strategies/ephemeral-container.d.ts +9 -0
- package/lib/runtime/workspace/strategies/ephemeral-container.js +37 -10
- package/lib/runtime/workspace/strategies/git-worktree.d.ts +15 -1
- package/lib/runtime/workspace/strategies/git-worktree.js +53 -1
- package/lib/sdk/README.md +82 -82
- package/lib/sdk/index.cjs +828 -815
- package/lib/sdk/index.d.ts +982 -982
- package/lib/sdk/index.types.ts +933 -933
- package/oxe/agents/oxe-assumptions-analyzer.md +136 -136
- package/oxe/agents/oxe-codebase-mapper.md +142 -142
- package/oxe/agents/oxe-debugger.md +145 -145
- package/oxe/agents/oxe-executor.md +139 -139
- package/oxe/agents/oxe-integration-checker.md +142 -142
- package/oxe/agents/oxe-plan-checker.md +143 -143
- package/oxe/agents/oxe-planner.md +151 -151
- package/oxe/agents/oxe-research-synthesizer.md +146 -146
- package/oxe/agents/oxe-researcher.md +163 -163
- package/oxe/agents/oxe-ui-auditor.md +151 -151
- package/oxe/agents/oxe-ui-checker.md +157 -157
- package/oxe/agents/oxe-ui-researcher.md +179 -179
- package/oxe/agents/oxe-validation-auditor.md +154 -154
- package/oxe/agents/oxe-verifier.md +132 -132
- package/oxe/migrations/config-migrations.json +15 -0
- package/oxe/personas/README.md +91 -91
- package/oxe/personas/architect.md +149 -149
- package/oxe/personas/db-specialist.md +149 -149
- package/oxe/personas/debugger.md +155 -155
- package/oxe/personas/executor.md +164 -164
- package/oxe/personas/planner.md +165 -165
- package/oxe/personas/researcher.md +148 -148
- package/oxe/personas/ui-specialist.md +164 -164
- package/oxe/personas/verifier.md +174 -174
- package/oxe/schemas/plan.schema.json +101 -85
- package/oxe/schemas/role-plan.schema.json +50 -0
- package/oxe/schemas/swarm-run.schema.json +130 -130
- package/oxe/templates/CONFIG.md +290 -105
- package/oxe/templates/DISCUSS.template.md +45 -44
- package/oxe/templates/EXECUTION-RUNTIME.template.md +68 -68
- package/oxe/templates/FIXTURE-PACK.template.json +41 -41
- package/oxe/templates/FIXTURE-PACK.template.md +30 -30
- package/oxe/templates/GLOSSARY.template.md +9 -0
- package/oxe/templates/IMPLEMENTATION-PACK.template.json +68 -68
- package/oxe/templates/IMPLEMENTATION-PACK.template.md +48 -48
- package/oxe/templates/PLAN.template.md +151 -151
- package/oxe/templates/PLUGINS.md +108 -108
- package/oxe/templates/PRD.template.md +53 -0
- package/oxe/templates/REFERENCE-ANCHORS.template.md +39 -35
- package/oxe/templates/RESEARCH.template.md +65 -57
- package/oxe/templates/RFC.template.md +43 -0
- package/oxe/templates/SPEC.template.md +119 -119
- package/oxe/templates/STATE-REFERENCE.md +125 -125
- package/oxe/templates/STATE.md +30 -30
- package/oxe/templates/SUMMARY.template.md +50 -50
- package/oxe/templates/VISUAL-INPUTS.template.json +27 -27
- package/oxe/templates/VISUAL-INPUTS.template.md +36 -36
- package/oxe/templates/config.template.json +38 -38
- package/oxe/templates/finding-rules.json +22 -0
- package/oxe/templates/stress-methods.md +33 -0
- package/oxe/workflows/agent-mode.md +150 -150
- package/oxe/workflows/alm.md +50 -0
- package/oxe/workflows/compact/plan.md +149 -0
- package/oxe/workflows/compact/spec.md +114 -0
- package/oxe/workflows/compact.md +45 -44
- package/oxe/workflows/conduct.md +149 -149
- package/oxe/workflows/debug.md +43 -43
- package/oxe/workflows/discuss.md +98 -86
- package/oxe/workflows/distill.md +164 -164
- package/oxe/workflows/execute.md +273 -269
- package/oxe/workflows/forensics.md +53 -53
- package/oxe/workflows/help.md +364 -355
- package/oxe/workflows/lean/execute.md +43 -0
- package/oxe/workflows/lean/plan.md +60 -0
- package/oxe/workflows/lean/spec.md +61 -0
- package/oxe/workflows/memory.md +163 -163
- package/oxe/workflows/next.md +47 -45
- package/oxe/workflows/oxe.md +168 -150
- package/oxe/workflows/plan.md +563 -556
- package/oxe/workflows/quick.md +199 -185
- package/oxe/workflows/references/alm-refine.md +55 -0
- package/oxe/workflows/references/azure-in-plan.md +5 -0
- package/oxe/workflows/references/change-management.md +48 -0
- package/oxe/workflows/references/flow-robustness-contract.md +80 -80
- package/oxe/workflows/references/grill.md +74 -0
- package/oxe/workflows/references/next-step-footer.md +33 -0
- package/oxe/workflows/references/plan-json-acceptance-program.md +174 -143
- package/oxe/workflows/references/product-docs-alm.md +51 -0
- package/oxe/workflows/references/workflow-runtime-contracts.json +1167 -1151
- package/oxe/workflows/research.md +67 -66
- package/oxe/workflows/route.md +32 -32
- package/oxe/workflows/scan.md +356 -355
- package/oxe/workflows/ship.md +93 -142
- package/oxe/workflows/size-budget.json +62 -0
- package/oxe/workflows/spec.md +615 -619
- package/oxe/workflows/swarm/board.md +119 -119
- package/oxe/workflows/swarm/scout.md +170 -170
- package/oxe/workflows/swarm-mode.md +280 -280
- package/oxe/workflows/ui-review.md +37 -37
- package/oxe/workflows/ui-spec.md +32 -32
- package/oxe/workflows/verify.md +273 -255
- package/package.json +134 -132
- package/packages/runtime/package.json +18 -18
- package/packages/runtime/src/compiler/graph-compiler.ts +349 -336
- package/packages/runtime/src/context/context-pack-builder.ts +339 -339
- package/packages/runtime/src/delivery/promotion-pipeline.ts +397 -342
- package/packages/runtime/src/events/catalog.ts +63 -45
- package/packages/runtime/src/executor/action-tool-map.ts +52 -50
- package/packages/runtime/src/executor/adapters/antigravity-cli.ts +619 -0
- package/packages/runtime/src/executor/adapters/claude-cli.ts +367 -285
- package/packages/runtime/src/executor/adapters/grok-cli.ts +392 -0
- package/packages/runtime/src/executor/adapters/http-openai.ts +16 -16
- package/packages/runtime/src/executor/adapters/registry.ts +53 -33
- package/packages/runtime/src/executor/adapters/types.ts +24 -24
- package/packages/runtime/src/executor/built-in-tools.ts +525 -333
- package/packages/runtime/src/executor/index.ts +23 -16
- package/packages/runtime/src/executor/llm-task-executor.ts +854 -336
- package/packages/runtime/src/executor/node-context.ts +226 -210
- package/packages/runtime/src/executor/node-prompt-builder.ts +69 -67
- package/packages/runtime/src/executor/quota-patterns.ts +41 -0
- package/packages/runtime/src/executor/shell-argv.ts +144 -66
- package/packages/runtime/src/executor/stream-completion.ts +230 -160
- package/packages/runtime/src/index.ts +56 -54
- package/packages/runtime/src/models/failure.ts +22 -13
- package/packages/runtime/src/models/run.ts +25 -24
- package/packages/runtime/src/plugins/capability-adapter.ts +313 -313
- package/packages/runtime/src/plugins/plugin-abi.ts +106 -106
- package/packages/runtime/src/plugins/plugin-registry.ts +241 -241
- package/packages/runtime/src/program/index.ts +1 -1
- package/packages/runtime/src/program/program-model.ts +293 -233
- package/packages/runtime/src/projection/projection-engine.ts +386 -361
- package/packages/runtime/src/reducers/run-state-reducer.ts +365 -329
- package/packages/runtime/src/scheduler/multi-agent-coordinator.ts +1017 -1017
- package/packages/runtime/src/scheduler/run-journal.ts +107 -105
- package/packages/runtime/src/scheduler/scheduler.ts +2081 -1144
- package/packages/runtime/src/verification/contract-exports.ts +203 -203
- package/packages/runtime/src/verification/index.ts +3 -3
- package/packages/runtime/src/verification/runner-timeout.ts +17 -0
- package/packages/runtime/src/verification/test-report-parsers.ts +204 -198
- package/packages/runtime/src/verification/verification-compiler.ts +1074 -766
- package/packages/runtime/src/verification/verification-manifest.ts +296 -281
- package/packages/runtime/src/workspace/index.ts +6 -5
- package/packages/runtime/src/workspace/strategies/ephemeral-container.ts +159 -126
- package/packages/runtime/src/workspace/strategies/git-worktree.ts +190 -150
- package/packages/runtime/tsconfig.json +24 -23
- package/vscode-extension/.vscodeignore +9 -9
- package/vscode-extension/LICENSE +21 -21
- package/vscode-extension/package.json +193 -193
- package/vscode-extension/src/extension.js +320 -320
|
@@ -0,0 +1,1160 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 1.21.2 (G30): the existing test suites that import a task's files and are not in its verify or scope.
|
|
5
|
+
*
|
|
6
|
+
* Three paid redos in one round had the same cause: the task changed a file (terminal.service.ts, desktop.ts, a policy
|
|
7
|
+
* list) that a test OUTSIDE `files` imports; the verify did not run it, the CI/related tests did, and the red was out of
|
|
8
|
+
* the task's scope (CR-07, CR-08). `plan lint` now lists, per task, the suites that import any file in `files` and are
|
|
9
|
+
* neither in `files`, nor named by the task's verify, nor its acceptance tests:
|
|
10
|
+
* - a warning by default (add the suite to the verify, or to `files` if the task may have to change it);
|
|
11
|
+
* - an error when the task's text names an exported list or constant (`export const NAME = [ … ]` / `{ … }` / a
|
|
12
|
+
* literal) of the file that the suite imports by name — the suite asserts on what the task is about to change.
|
|
13
|
+
* `lint.suite_impact`: "warn" turns the error into a warning; "off" disables the rule.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
const { spawnSync } = require('child_process');
|
|
19
|
+
|
|
20
|
+
const CODE_RE = /\.(c|m)?[jt]sx?$/i;
|
|
21
|
+
const TEST_RE = /(^|\/)(tests?|__tests__|spec)\/|\.(test|spec)\.[cm]?[jt]sx?$/i;
|
|
22
|
+
const ACCEPT_OR_FROZEN_DIR_RE = /(?:^|\/)(?:acceptance|tests\/acceptance|e2e\/acceptance|tests\/oxe\d+)\//i;
|
|
23
|
+
const PARKED_DIR_RE = /(?:^|\/)parked[^/]*\//i;
|
|
24
|
+
const SKIP_DIR_RE = /(^|\/)(node_modules|dist|build|out|coverage|\.oxe)\//;
|
|
25
|
+
const norm = (p) => String(p || '').replace(/\\/g, '/').replace(/^\.\//, '');
|
|
26
|
+
const isSupersededTask = (t) => !t || t.status === 'superseded' || Boolean(t.superseded) || Boolean(t.merged_into);
|
|
27
|
+
const isDoneTask = (t) => Boolean(t && !isSupersededTask(t) && (t.done === true || t.status === 'done'));
|
|
28
|
+
const isInactiveTask = (t) => !t || isDoneTask(t) || isSupersededTask(t);
|
|
29
|
+
|
|
30
|
+
function taskCriteriaOf(task) {
|
|
31
|
+
if (!task || typeof task !== 'object') return [];
|
|
32
|
+
const raw = [
|
|
33
|
+
...(Array.isArray(task.acceptance) ? task.acceptance : []),
|
|
34
|
+
...(Array.isArray(task.aceite) ? task.aceite : []),
|
|
35
|
+
];
|
|
36
|
+
return [...new Set(raw.map((c) => String(c || '').trim().toUpperCase()).filter(Boolean))];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function criterionMatches(taskCriteria, entryCriterion) {
|
|
40
|
+
const ec = String(entryCriterion || '').trim().toUpperCase();
|
|
41
|
+
if (!ec || !Array.isArray(taskCriteria) || !taskCriteria.length) return false;
|
|
42
|
+
return taskCriteria.some((raw) => {
|
|
43
|
+
const tc = String(raw || '').trim().toUpperCase();
|
|
44
|
+
if (!tc) return false;
|
|
45
|
+
return tc === ec || tc.startsWith(`${ec}.`) || ec.startsWith(`${tc}.`);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function trackedFiles(root) {
|
|
50
|
+
const r = spawnSync('git', ['-c', 'core.quotepath=false', 'ls-files'], { cwd: root, encoding: 'utf8', windowsHide: true, maxBuffer: 64 * 1024 * 1024 });
|
|
51
|
+
if (r.status === 0 && r.stdout) return r.stdout.split(/\r?\n/).map(norm).filter(Boolean);
|
|
52
|
+
const out = [];
|
|
53
|
+
const walk = (dir) => {
|
|
54
|
+
let entries = [];
|
|
55
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }
|
|
56
|
+
for (const e of entries) {
|
|
57
|
+
if (['node_modules', '.git', '.oxe', 'dist', 'build'].includes(e.name)) continue;
|
|
58
|
+
const full = path.join(dir, e.name);
|
|
59
|
+
if (e.isDirectory()) walk(full);
|
|
60
|
+
else if (e.isFile()) out.push(norm(path.relative(root, full)));
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
walk(root);
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Exported lists and constants of a source file: `export const NAME = [` / `{` / a literal / Object.freeze(. */
|
|
68
|
+
function exportedConstants(text) {
|
|
69
|
+
const names = new Set();
|
|
70
|
+
for (const m of String(text || '').matchAll(/\bexport\s+const\s+([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(\[|\{|Object\.freeze\(|['"`\d-]|new\s+(?:Set|Map)\()/g)) names.add(m[1]);
|
|
71
|
+
for (const m of String(text || '').matchAll(/\bexports\.([A-Za-z_$][\w$]*)\s*=\s*(\[|\{|Object\.freeze\(|['"`\d-])/g)) names.add(m[1]);
|
|
72
|
+
return names;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** target file → [{ test, names, wildcard }] for every test file of the repo (following barrel re-exports by symbol). */
|
|
76
|
+
function importIndex(root, { files = null, readText = null } = {}) {
|
|
77
|
+
const pb = require('./oxe-plan-build.cjs');
|
|
78
|
+
const testScope = require('./oxe-test-scope.cjs');
|
|
79
|
+
const all = (files || trackedFiles(root)).filter((f) => CODE_RE.test(f) && !SKIP_DIR_RE.test(f));
|
|
80
|
+
const known = new Set(all);
|
|
81
|
+
const aliases = pb.loadPathAliases(root);
|
|
82
|
+
const read = readText || ((f) => { try { return fs.readFileSync(path.join(root, f), 'utf8'); } catch { return ''; } });
|
|
83
|
+
const byTarget = new Map();
|
|
84
|
+
const addHit = (targetPath, test, names, wildcard) => {
|
|
85
|
+
if (!targetPath || targetPath === test) return;
|
|
86
|
+
if (!byTarget.has(targetPath)) byTarget.set(targetPath, []);
|
|
87
|
+
const list = byTarget.get(targetPath);
|
|
88
|
+
const existing = list.find((e) => e.test === test);
|
|
89
|
+
if (existing) {
|
|
90
|
+
if (wildcard) existing.wildcard = true;
|
|
91
|
+
for (const n of names || []) if (!existing.names.includes(n)) existing.names.push(n);
|
|
92
|
+
} else {
|
|
93
|
+
list.push({ test, names: [...(names || [])], wildcard: Boolean(wildcard) });
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
for (const test of all.filter((f) => TEST_RE.test(f))) {
|
|
97
|
+
for (const imp of pb.extractModuleImports(read(test))) {
|
|
98
|
+
const target = pb.resolveModuleSpecifier(test, imp.specifier, known, aliases);
|
|
99
|
+
if (!target || target === test) continue;
|
|
100
|
+
addHit(target, test, imp.names || [], Boolean(imp.wildcard));
|
|
101
|
+
if (!readText && root && fs.existsSync(path.join(root, target))) {
|
|
102
|
+
const exp = testScope.parseModuleExports(root, target);
|
|
103
|
+
if (exp && (exp.namedReexports.size > 0 || exp.wildcardReexports.length > 0)) {
|
|
104
|
+
const cur = { path: target, exists: true };
|
|
105
|
+
if (imp.wildcard || !(imp.names && imp.names.length)) {
|
|
106
|
+
if (exp.localExports.size === 0) {
|
|
107
|
+
for (const leaf of testScope.collectPureBarrelTargets(root, cur)) {
|
|
108
|
+
if (leaf.path !== target) addHit(leaf.path, test, [], true);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
for (const sym of imp.names) {
|
|
113
|
+
for (const def of testScope.findSymbolDefinitions(root, cur, sym)) {
|
|
114
|
+
if (def.path !== target) addHit(def.path, test, [def.resolvedSymbol || sym], false);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return { byTarget, read };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const words = (s) => new Set(String(s || '').match(/[A-Za-z_$][\w$]*/g) || []);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* G30b (OxeSpace 14/11, OxeCode F4 T20, ~US$ 15): the data a suite reads — a baseline fixture (palette-commands.base.json)
|
|
129
|
+
* the guard compares against, a verb list. Literal paths only: an import/require of a data file, readFileSync /
|
|
130
|
+
* path.join / path.resolve with string literals. Resolved against the test's folder and the repo root; existing
|
|
131
|
+
* files only.
|
|
132
|
+
*/
|
|
133
|
+
const DATA_RE = /\.(json|ya?ml|txt|csv|snap|md)$/i;
|
|
134
|
+
function dataFilesOf(root, test, text, known) {
|
|
135
|
+
const out = new Set();
|
|
136
|
+
const dir = path.posix.dirname(test);
|
|
137
|
+
const consider = (rel) => {
|
|
138
|
+
const r = norm(rel);
|
|
139
|
+
if (!DATA_RE.test(r)) return;
|
|
140
|
+
for (const cand of [path.posix.normalize(path.posix.join(dir, r)), path.posix.normalize(r)]) {
|
|
141
|
+
if (known.has(cand) || fs.existsSync(path.join(root, cand))) { out.add(cand); return; }
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const src = String(text || '');
|
|
145
|
+
for (const m of src.matchAll(/\b(?:import|export)\s+[\s\S]*?\s+from\s*['"]([^'"]+)['"]|\brequire\(\s*['"]([^'"]+)['"]\s*\)|\bimport\(\s*['"]([^'"]+)['"]\s*\)/g)) consider(m[1] || m[2] || m[3]);
|
|
146
|
+
// readFileSync('a/b.json', 'utf8') / path.join(__dirname, 'fixtures', 'x.json') / path.resolve('tests/fixtures/x.json')
|
|
147
|
+
for (const m of src.matchAll(/\b(readFileSync|readFile|path\.(?:join|resolve))\(([^)]*)\)/g)) {
|
|
148
|
+
const parts = [...m[2].matchAll(/['"`]([^'"`$]+)['"`]/g)].map((p) => p[1]);
|
|
149
|
+
if (!parts.length) continue;
|
|
150
|
+
const isJoined = /^path\./.test(m[1]) || /\bpath\.(?:join|resolve)\s*\(/.test(m[2]);
|
|
151
|
+
consider(isJoined ? parts.join('/') : parts[0]);
|
|
152
|
+
}
|
|
153
|
+
return [...out];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Per task not done: the suites that import its files and are outside its verify/scope.
|
|
158
|
+
* @returns {{ task: string, file: string, suites: { test: string, level: 'warn'|'error', names: string[] }[] }[]}
|
|
159
|
+
*/
|
|
160
|
+
function suiteImpact(root, planDoc, options = {}) {
|
|
161
|
+
const tasks = (planDoc && Array.isArray(planDoc.tasks) ? planDoc.tasks : []).filter((t) => !isInactiveTask(t));
|
|
162
|
+
if (!tasks.length) return [];
|
|
163
|
+
const { byTarget, read } = options.index || importIndex(root, options);
|
|
164
|
+
const known = new Set(options.files || trackedFiles(root));
|
|
165
|
+
const accept = (planDoc && Array.isArray(planDoc.acceptance_tests) ? planDoc.acceptance_tests : []);
|
|
166
|
+
// G38: a suite another pending task owns (in its files) at the same or a later wave is not asked into this verify —
|
|
167
|
+
// it turns green only with that task (OxeCode F6: u83, owned by T30, was put in T27's verify)
|
|
168
|
+
const laterOwner = new Map();
|
|
169
|
+
for (const o of tasks) for (const f of o.files || []) {
|
|
170
|
+
const p = norm(typeof f === 'string' ? f : f && f.path);
|
|
171
|
+
if (p && TEST_RE.test(p) && ACCEPT_OR_FROZEN_DIR_RE.test(p)) laterOwner.set(p, [...(laterOwner.get(p) || []), o]);
|
|
172
|
+
}
|
|
173
|
+
// cross-review 15/11: the frozen entries count as G38 counts them — a frozen test is never in its owner's files, and
|
|
174
|
+
// G30 asking it into the earlier verify while G38 asks it out was a deadlock
|
|
175
|
+
for (const a of accept) {
|
|
176
|
+
if (!a) continue;
|
|
177
|
+
const owners = a.task
|
|
178
|
+
? tasks.filter((o) => String(o.id).toUpperCase() === String(a.task).toUpperCase())
|
|
179
|
+
: tasks.filter((o) => criterionMatches(taskCriteriaOf(o), a.criterion));
|
|
180
|
+
for (const f of a.files || []) {
|
|
181
|
+
const p = norm(typeof f === 'string' ? f : f && f.path);
|
|
182
|
+
if (p) laterOwner.set(p, [...(laterOwner.get(p) || []), ...owners]);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const ownedLater = (test, t) => (laterOwner.get(test) || []).some((o) => o.id !== t.id && !(Number(o.wave) < Number(t.wave)));
|
|
186
|
+
const findings = [];
|
|
187
|
+
for (const t of tasks) {
|
|
188
|
+
const scope = (t.files || []).map((f) => norm(typeof f === 'string' ? f : f && f.path)).filter(Boolean);
|
|
189
|
+
const verifyText = [...((t.verify && t.verify.commands) || []), t.verify && t.verify.command, t.verifyCommand].filter(Boolean).join(' \n ').replace(/\\/g, '/');
|
|
190
|
+
const ownAccept = new Set(accept.filter((a) => a && (a.task === t.id || (t.acceptance || []).includes(a.criterion))).flatMap((a) => (a.files || []).map((f) => norm(typeof f === 'string' ? f : f.path))));
|
|
191
|
+
const testScope = require('./oxe-test-scope.cjs');
|
|
192
|
+
const inScope = (f) => scope.some((s) => testScope.covers(s, f));
|
|
193
|
+
const namedInVerify = (test) => {
|
|
194
|
+
if (verifyText.includes(test)) return true;
|
|
195
|
+
const base = path.posix.basename(test).replace(/\.(test|spec)\.[cm]?[jt]sx?$/i, '').replace(/\.[cm]?[jt]sx?$/i, '');
|
|
196
|
+
return base.length >= 4 && verifyText.includes(base);
|
|
197
|
+
};
|
|
198
|
+
const taskText = JSON.stringify({ ...t, files: undefined, verify: undefined });
|
|
199
|
+
const mentioned = words(taskText);
|
|
200
|
+
const targets = [...byTarget.keys()].filter((f) => inScope(f));
|
|
201
|
+
for (const file of targets) {
|
|
202
|
+
const consts = exportedConstants(read(file));
|
|
203
|
+
const suites = [];
|
|
204
|
+
const seen = new Set();
|
|
205
|
+
const data = [];
|
|
206
|
+
for (const imp of byTarget.get(file)) {
|
|
207
|
+
if (seen.has(imp.test)) continue;
|
|
208
|
+
seen.add(imp.test);
|
|
209
|
+
// G38: a later task's acceptance test is that task's — neither its suite nor its data are asked of this one
|
|
210
|
+
if (!inScope(imp.test) && !ownAccept.has(imp.test) && ownedLater(imp.test, t)) continue;
|
|
211
|
+
// G30b: the data the suite reads, outside the task's files — also for a suite already in the verify (the T20
|
|
212
|
+
// guard was in the verify; its baseline fixture was not in files)
|
|
213
|
+
if (!inScope(imp.test)) for (const d of dataFilesOf(root, imp.test, read(imp.test), known)) if (!inScope(d)) data.push({ test: imp.test, file: d });
|
|
214
|
+
if (inScope(imp.test) || ownAccept.has(imp.test) || namedInVerify(imp.test)) continue;
|
|
215
|
+
const asserted = imp.names.filter((n) => consts.has(n) && mentioned.has(n));
|
|
216
|
+
suites.push({ test: imp.test, level: asserted.length ? 'error' : 'warn', names: asserted });
|
|
217
|
+
}
|
|
218
|
+
if (suites.length || data.length) findings.push({ task: t.id, file, suites, data });
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return findings;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* OxeSpace 15/11 (OxeCode F6 T27, US$ 16.91 in 3 attempts): a test in a task's verify that a LATER pending task owns
|
|
226
|
+
* (in its files, or its frozen acceptance test) — e.g. u83 released for T30 (wave 3) in T27's verify (wave 1) — is
|
|
227
|
+
* unpassable at the task's point in the order. Per pending task: each such test, with its owner.
|
|
228
|
+
* @returns {{ task: string, wave: number|null, test: string, owner: string, owner_wave: number|null }[]}
|
|
229
|
+
*/
|
|
230
|
+
function laterOwnedTests(planDoc) {
|
|
231
|
+
const all = (planDoc && Array.isArray(planDoc.tasks) ? planDoc.tasks : []).filter(Boolean);
|
|
232
|
+
const pending = all.filter((t) => !isInactiveTask(t));
|
|
233
|
+
if (pending.length < 2) return [];
|
|
234
|
+
const byId = new Map(all.map((t) => [t.id, t]));
|
|
235
|
+
const ancestors = (id, seen = new Set()) => {
|
|
236
|
+
for (const d of (byId.get(id) || {}).depends_on || (byId.get(id) || {}).dependsOn || []) if (!seen.has(d)) { seen.add(d); ancestors(d, seen); }
|
|
237
|
+
return seen;
|
|
238
|
+
};
|
|
239
|
+
const owners = new Map(); // test file → pending owner ids
|
|
240
|
+
const frozenOwners = new Set(); // `${file}\0${id}`: the owner holds the file as a FROZEN acceptance entry
|
|
241
|
+
const own =(file, id) => { const f = norm(file); if (f && TEST_RE.test(f)) owners.set(f, [...new Set([...(owners.get(f) || []), id])]); };
|
|
242
|
+
// a shared suite many tasks extend (brand-targets, design-lint) is not "green only later": only ACCEPTANCE tests count —
|
|
243
|
+
// a frozen entry of the owner, or a file of its scope under an acceptance/ or tests/oxe<N>/ folder
|
|
244
|
+
for (const t of pending) for (const f of t.files || []) { const p = norm(typeof f === 'string' ? f : f && f.path); if (ACCEPT_OR_FROZEN_DIR_RE.test(p)) own(p, t.id); }
|
|
245
|
+
for (const a of (planDoc && Array.isArray(planDoc.acceptance_tests) ? planDoc.acceptance_tests : [])) {
|
|
246
|
+
if (!a) continue;
|
|
247
|
+
const ids = a.task
|
|
248
|
+
? [String(a.task).toUpperCase()]
|
|
249
|
+
: pending.filter((t) => criterionMatches(taskCriteriaOf(t), a.criterion)).map((t) => t.id);
|
|
250
|
+
for (const id of ids) if (pending.some((t) => String(t.id).toUpperCase() === String(id).toUpperCase())) for (const f of a.files || []) { own(typeof f === 'string' ? f : f.path, id); frozenOwners.add(`${norm(typeof f === 'string' ? f : f.path)}\u0000${id}`); }
|
|
251
|
+
}
|
|
252
|
+
const waveOf = (t) => (Number.isFinite(Number(t && t.wave)) ? Number(t.wave) : null);
|
|
253
|
+
const out = [];
|
|
254
|
+
for (const t of pending) {
|
|
255
|
+
// OxeSpace 15/11 (F6 T44, wave 18): a vitest file argument is a SUBSTRING filter — `pu03-app-version.test.ts` also
|
|
256
|
+
// ran T59's `pu03-app-version.test.tsx` (wave 33). Each command's arguments are matched as filters; a command
|
|
257
|
+
// narrowed by -t / --testNamePattern is taken as running its own cases only.
|
|
258
|
+
const commands = [...((t.verify && t.verify.commands) || []), t.verify && t.verify.command, t.verifyCommand].filter(Boolean).map((c) => String(c).replace(/\\/g, '/'));
|
|
259
|
+
const tests = [];
|
|
260
|
+
const directHits = new Set(); // matched file named directly as a verify argument
|
|
261
|
+
const viaMap = new Map(); // matched file → Set of verify arguments that substring-select it (when not the same path)
|
|
262
|
+
// cross-review 15/11: each SUBCOMMAND on its own (`a -t x && b`): a -t narrows only its subcommand, and only the
|
|
263
|
+
// substring expansion — a path named exactly is always run; a trailing `$` anchors the argument; `node --test`
|
|
264
|
+
// takes exact paths (never a substring filter)
|
|
265
|
+
for (const sub of commands.flatMap((c) => c.split(/\s*(?:&&|\|\||;)\s*/)).filter(Boolean)) {
|
|
266
|
+
const narrowed = /(^|\s)(-t|--testNamePattern|--grep|-g)(\s|=)/.test(sub);
|
|
267
|
+
const exactRunner = /\bnode\b[^|;&]*\s--test(\s|=|$)/.test(sub);
|
|
268
|
+
for (const raw of sub.match(/[^\s"'`]+/g) || []) {
|
|
269
|
+
const anchored = raw.endsWith('$');
|
|
270
|
+
const a = norm(anchored ? raw.slice(0, -1) : raw);
|
|
271
|
+
if (!(a.includes('/') && TEST_RE.test(a) && /\.[cm]?[jt]sx?$/i.test(a))) continue;
|
|
272
|
+
const substring = !narrowed && !anchored && !exactRunner;
|
|
273
|
+
for (const known of owners.keys()) {
|
|
274
|
+
if (known === a) {
|
|
275
|
+
tests.push(known);
|
|
276
|
+
directHits.add(known);
|
|
277
|
+
} else if (substring && known.includes(a)) {
|
|
278
|
+
tests.push(known);
|
|
279
|
+
if (!viaMap.has(known)) viaMap.set(known, new Set());
|
|
280
|
+
viaMap.get(known).add(a);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
const anc = ancestors(t.id);
|
|
286
|
+
const ownFiles = new Set((t.files || []).map((f) => norm(typeof f === 'string' ? f : f && f.path)));
|
|
287
|
+
for (const test of [...new Set(tests)]) {
|
|
288
|
+
for (const ownerId of owners.get(test) || []) {
|
|
289
|
+
if (ownerId === t.id || anc.has(ownerId)) continue; // its own, or done before it by the dependency order
|
|
290
|
+
// cross-review 15/11: a mutable test this task writes (in its files), that a later task only extends, is this
|
|
291
|
+
// task's to run — only a later task's FROZEN entry is out of its reach
|
|
292
|
+
if (ownFiles.has(test) && !frozenOwners.has(`${test}\u0000${ownerId}`)) continue;
|
|
293
|
+
const owner = byId.get(ownerId);
|
|
294
|
+
const w = waveOf(t);
|
|
295
|
+
const ow = waveOf(owner);
|
|
296
|
+
if (w != null && ow != null && ow < w) continue; // the owner's wave runs first
|
|
297
|
+
if (directHits.has(test)) out.push({ task: t.id, wave: w, test, owner: ownerId, owner_wave: ow });
|
|
298
|
+
for (const viaArg of viaMap.get(test) || []) {
|
|
299
|
+
out.push({ task: t.id, wave: w, test, owner: ownerId, owner_wave: ow, via: viaArg });
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return out;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* G39 (OxeSpace 15/11, OxeQuery polish T1, US$ 11.70): the task's frozen A1 needs `IPC_CHANNELS.agentActivity.changed`,
|
|
309
|
+
* while a 1.5.0 frozen test pins `expect(IPC_CHANNELS.agentActivity).toEqual({ list, detail, badge })` — no change passes
|
|
310
|
+
* both. For each member path a pending task's frozen test asks for and the product does not have yet (`X.y.z`), the
|
|
311
|
+
* tests OUTSIDE the plan's frozen entries that assert its parent (`X.y`) by exact equality are named, file:line.
|
|
312
|
+
* @returns {{ task: string, path: string, parent: string, entry: string, pinned_by: string, line: string }[]}
|
|
313
|
+
*/
|
|
314
|
+
function pinnedByExisting(root, planDoc, options = {}) {
|
|
315
|
+
const git = (args) => { const r = spawnSync('git', ['-c', 'core.quotepath=false', ...args], { cwd: root, encoding: 'utf8', windowsHide: true, maxBuffer: 64 * 1024 * 1024 }); return r.status === 0 ? r.stdout : ''; };
|
|
316
|
+
const read = options.readText || ((f) => { try { return fs.readFileSync(path.join(root, f), 'utf8'); } catch { return ''; } });
|
|
317
|
+
const tasks = (planDoc && Array.isArray(planDoc.tasks) ? planDoc.tasks : []).filter((t) => !isInactiveTask(t));
|
|
318
|
+
const accept = planDoc && Array.isArray(planDoc.acceptance_tests) ? planDoc.acceptance_tests : [];
|
|
319
|
+
const planFrozen = new Set(accept.flatMap((a) => (a && a.files) || []).map((f) => norm(typeof f === 'string' ? f : f.path)));
|
|
320
|
+
// a member path, never a method call (`X.y.includes(`) — cross-review 15/11
|
|
321
|
+
const PATH_RE = /(?<![\w$.])([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*){2,})(?![\w$(])/g;
|
|
322
|
+
const NATIVE_LEAF = /^(length|prototype|constructor|size|name)$/;
|
|
323
|
+
// the scope a task can change: its files and its ancestors' files (a mutable test there is the task's to update)
|
|
324
|
+
const byId = new Map((planDoc && Array.isArray(planDoc.tasks) ? planDoc.tasks : []).filter(Boolean).map((t) => [t.id, t]));
|
|
325
|
+
const scopeOf = (t) => {
|
|
326
|
+
const out = new Set();
|
|
327
|
+
const stack = [t.id];
|
|
328
|
+
const seenIds = new Set();
|
|
329
|
+
while (stack.length) {
|
|
330
|
+
const id = stack.pop();
|
|
331
|
+
if (seenIds.has(id)) continue;
|
|
332
|
+
seenIds.add(id);
|
|
333
|
+
const x = byId.get(id);
|
|
334
|
+
if (!x) continue;
|
|
335
|
+
for (const f of x.files || []) out.add(norm(typeof f === 'string' ? f : f && f.path));
|
|
336
|
+
stack.push(...(x.depends_on || x.dependsOn || []));
|
|
337
|
+
}
|
|
338
|
+
return out;
|
|
339
|
+
};
|
|
340
|
+
// 1. the candidates: member paths the pending tasks' frozen tests name
|
|
341
|
+
const candidates = [];
|
|
342
|
+
const seen = new Set();
|
|
343
|
+
for (const t of tasks) {
|
|
344
|
+
const own = accept.filter((a) => a && (a.task === t.id || (!a.task && (t.acceptance || []).includes(a.criterion))));
|
|
345
|
+
for (const a of own) {
|
|
346
|
+
for (const f of a.files || []) {
|
|
347
|
+
const entry = norm(typeof f === 'string' ? f : f.path);
|
|
348
|
+
for (const m of read(entry).matchAll(PATH_RE)) {
|
|
349
|
+
const full = m[1];
|
|
350
|
+
if (/^(expect|vi|jest|Object|Array|JSON|Math|Promise|console|process|window|document|this|module|exports|require|t|it|describe|screen|page|user)\./.test(full)) continue;
|
|
351
|
+
if (NATIVE_LEAF.test(full.slice(full.lastIndexOf('.') + 1))) continue;
|
|
352
|
+
const key = `${t.id}\u0000${full}`;
|
|
353
|
+
if (seen.has(key)) continue;
|
|
354
|
+
seen.add(key);
|
|
355
|
+
candidates.push({ task: t.id, full, parent: full.slice(0, full.lastIndexOf('.')), entry });
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (!candidates.length) return [];
|
|
361
|
+
// batched git grep (a lint must stay fast): -o says which needle matched each line
|
|
362
|
+
const grepBatch = (needles, extra) => {
|
|
363
|
+
const lines = [];
|
|
364
|
+
const list = [...new Set(needles)];
|
|
365
|
+
for (let i = 0; i < list.length; i += 150) {
|
|
366
|
+
const args = ['grep', ...extra, '-I', '-F'];
|
|
367
|
+
for (const n of list.slice(i, i + 150)) args.push('-e', n);
|
|
368
|
+
// the working tree (tracked files), as read() sees it — line numbers and contents stay in sync (cross-review)
|
|
369
|
+
lines.push(...git(args).split(/\r?\n/).filter(Boolean));
|
|
370
|
+
}
|
|
371
|
+
return lines;
|
|
372
|
+
};
|
|
373
|
+
// 2. new for the product: the full path is in no tracked non-test file yet
|
|
374
|
+
const inProduct = new Set();
|
|
375
|
+
for (const l of grepBatch(candidates.map((c) => c.full), ['-o'])) {
|
|
376
|
+
const i = l.indexOf(':');
|
|
377
|
+
if (i > 0 && !TEST_RE.test(l.slice(0, i))) inProduct.add(l.slice(i + 1));
|
|
378
|
+
}
|
|
379
|
+
// …nor as an object-literal key of its parent (`agentActivity: { list: … }` already has .list): a non-test file that
|
|
380
|
+
// names the parent's last segment and has `leaf:` keeps the member
|
|
381
|
+
const lastSeg = (p) => p.slice(p.lastIndexOf('.') + 1);
|
|
382
|
+
// only the files that DECLARE the parent as an object literal (`seg: {` / `seg = {`), and only inside that literal
|
|
383
|
+
const parentFiles = new Map();
|
|
384
|
+
const declNeedles = [...new Set(candidates.map((c) => lastSeg(c.parent)))].flatMap((s) => [`${s}: {`, `${s}:{`, `${s} = {`]);
|
|
385
|
+
for (const l of grepBatch(declNeedles, ['-o'])) {
|
|
386
|
+
const i = l.indexOf(':');
|
|
387
|
+
if (i <= 0 || TEST_RE.test(l.slice(0, i))) continue;
|
|
388
|
+
const seg = l.slice(i + 1).replace(/\s*(:|=)\s*\{$/, '');
|
|
389
|
+
if (!parentFiles.has(seg)) parentFiles.set(seg, new Set());
|
|
390
|
+
parentFiles.get(seg).add(l.slice(0, i));
|
|
391
|
+
}
|
|
392
|
+
const literalOf = (text, at) => {
|
|
393
|
+
let depth = 0;
|
|
394
|
+
let q = null;
|
|
395
|
+
for (let i = at; i < text.length && i < at + 65536; i += 1) {
|
|
396
|
+
const ch = text[i];
|
|
397
|
+
const nx = text[i + 1];
|
|
398
|
+
if (q) { if (ch === '\\') { i += 1; continue; } if (ch === q) q = null; continue; }
|
|
399
|
+
// comments first: an apostrophe in `// user's channels` never opens a string (cross-review 15/11)
|
|
400
|
+
if (ch === '/' && nx === '/') { const e = text.indexOf('\n', i); i = e < 0 ? text.length : e; continue; }
|
|
401
|
+
if (ch === '/' && nx === '*') { const e = text.indexOf('*/', i + 2); i = e < 0 ? text.length : e + 1; continue; }
|
|
402
|
+
if (ch === '"' || ch === "'" || ch === '`') { q = ch; continue; }
|
|
403
|
+
if (ch === '{') depth += 1;
|
|
404
|
+
else if (ch === '}') { depth -= 1; if (depth === 0) return text.slice(at, i + 1); }
|
|
405
|
+
}
|
|
406
|
+
return '';
|
|
407
|
+
};
|
|
408
|
+
const keyed = (c) => {
|
|
409
|
+
const seg = lastSeg(c.parent);
|
|
410
|
+
const leaf = c.full.slice(c.full.lastIndexOf('.') + 1).replace(/[$]/g, '\\$');
|
|
411
|
+
const leafRe = new RegExp(`(^|[^\\w$.])${leaf}\\s*:`);
|
|
412
|
+
const declRe = new RegExp(`(^|[^\\w$.])${seg.replace(/[$]/g, '\\$')}\\s*(:|=)\\s*\\{`, 'g');
|
|
413
|
+
for (const f of parentFiles.get(seg) || []) {
|
|
414
|
+
const text = read(f);
|
|
415
|
+
for (const m of text.matchAll(declRe)) {
|
|
416
|
+
const obj = literalOf(text, m.index + m[0].length - 1);
|
|
417
|
+
// the leaf at the literal's own level is enough here (nested keys rarely share the name)
|
|
418
|
+
if (leafRe.test(obj)) return true;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return false;
|
|
422
|
+
};
|
|
423
|
+
const fresh = candidates.filter((c) => !inProduct.has(c.full) && !keyed(c));
|
|
424
|
+
if (!fresh.length) return [];
|
|
425
|
+
// 3. the tests outside the plan (and outside the task's scope) that pin the parent by exact equality — the matcher's
|
|
426
|
+
// argument is extracted with a balanced-parenthesis scanner (strings and comments skipped), never by indentation
|
|
427
|
+
const filesWithParent = new Map(); // file → set of parents it names
|
|
428
|
+
for (const l of grepBatch(fresh.map((c) => c.parent), ['-o'])) {
|
|
429
|
+
const i = l.indexOf(':');
|
|
430
|
+
if (i <= 0) continue;
|
|
431
|
+
const file = l.slice(0, i);
|
|
432
|
+
if (!TEST_RE.test(file) || planFrozen.has(file)) continue;
|
|
433
|
+
if (!filesWithParent.has(file)) filesWithParent.set(file, new Set());
|
|
434
|
+
filesWithParent.get(file).add(l.slice(i + 1));
|
|
435
|
+
}
|
|
436
|
+
const argOf = (text, open) => {
|
|
437
|
+
let depth = 0;
|
|
438
|
+
let q = null;
|
|
439
|
+
for (let i = open; i < text.length && i < open + 16384; i += 1) {
|
|
440
|
+
const ch = text[i];
|
|
441
|
+
const nx = text[i + 1];
|
|
442
|
+
if (q) { if (ch === '\\') { i += 1; continue; } if (ch === q) q = null; continue; }
|
|
443
|
+
if (ch === '/' && nx === '/') { const e = text.indexOf('\n', i); i = e < 0 ? text.length : e; continue; }
|
|
444
|
+
if (ch === '/' && nx === '*') { const e = text.indexOf('*/', i + 2); i = e < 0 ? text.length : e + 1; continue; }
|
|
445
|
+
if (ch === '"' || ch === "'" || ch === '`') { q = ch; continue; }
|
|
446
|
+
if (ch === '(') depth += 1;
|
|
447
|
+
else if (ch === ')') { depth -= 1; if (depth === 0) return text.slice(open + 1, i); }
|
|
448
|
+
}
|
|
449
|
+
return null;
|
|
450
|
+
};
|
|
451
|
+
const out = [];
|
|
452
|
+
for (const c of fresh) {
|
|
453
|
+
const t = byId.get(c.task);
|
|
454
|
+
const scope = t ? scopeOf(t) : new Set();
|
|
455
|
+
const esc = c.parent.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
456
|
+
// expect(X.y) or expect(Object.keys(X.y)) / (…).sort(), then (across a line break) .toEqual( / .toStrictEqual( / .toHaveLength(
|
|
457
|
+
const re = new RegExp(`expect\\(\\s*(?:Object\\.(?:keys|values|entries)\\(\\s*)?${esc}\\s*\\)?(?:\\s*\\.\\s*sort\\(\\s*\\))?\\s*\\)\\s*\\.\\s*(toEqual|toStrictEqual|toHaveLength)\\s*\\(`, 'g');
|
|
458
|
+
const leaf = c.full.slice(c.full.lastIndexOf('.') + 1);
|
|
459
|
+
const leafRe = new RegExp(`(^|[^\\w$])${leaf.replace(/[$]/g, '\\$')}\\s*:|['"\`]${leaf.replace(/[$]/g, '\\$')}['"\`]`);
|
|
460
|
+
for (const [file, parents] of filesWithParent) {
|
|
461
|
+
if (!parents.has(c.parent)) continue;
|
|
462
|
+
// a mutable test in the task's own scope (or an ancestor's) is the task's to update — not a conflict
|
|
463
|
+
const inScope = scope.has(file) || [...scope].some((s) => s && file.startsWith(`${s.replace(/\/+$/, '')}/`));
|
|
464
|
+
if (inScope && !/(^|\/)acceptance\//i.test(file)) continue;
|
|
465
|
+
const text = read(file);
|
|
466
|
+
for (const m of text.matchAll(re)) {
|
|
467
|
+
const open = m.index + m[0].length - 1;
|
|
468
|
+
const arg = argOf(text, open);
|
|
469
|
+
if (arg == null || leafRe.test(arg)) continue; // the pinned shape already has the leaf
|
|
470
|
+
const lineNo = text.slice(0, m.index).split('\n').length;
|
|
471
|
+
out.push({ task: c.task, path: c.full, parent: c.parent, entry: c.entry, pinned_by: `${file}:${lineNo}`, line: m[0].replace(/\s+/g, ' ').trim().slice(0, 160), frozen: /(^|\/)acceptance\//i.test(file) });
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return out;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function pinnedMessages(findings, { mode = 'error' } = {}) {
|
|
479
|
+
const errors = [];
|
|
480
|
+
const warnings = [];
|
|
481
|
+
for (const f of findings) {
|
|
482
|
+
const fix = f.frozen
|
|
483
|
+
? `precisa de um release desse teste (CR + spec freeze/amend) antes de ${f.task}`
|
|
484
|
+
: `inclua ${f.pinned_by.split(':')[0]} nos files de ${f.task} (ou de uma dependência) para atualizá-lo junto, ou release por CR se for congelado`;
|
|
485
|
+
const line = `${f.task}: o teste congelado ${f.entry} pede ${f.path}, mas ${f.pinned_by} fixa ${f.parent} por igualdade exata (\`${f.line}\`) — nenhuma mudança passa os dois: ${fix} [G39]`;
|
|
486
|
+
if (mode === 'error') errors.push(line); else warnings.push(line);
|
|
487
|
+
}
|
|
488
|
+
return { errors, warnings };
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
function laterOwnedMessages(findings, { mode = 'error' } = {}) {
|
|
492
|
+
const errors = [];
|
|
493
|
+
const warnings = [];
|
|
494
|
+
for (const f of findings) {
|
|
495
|
+
const line = `${f.task}${f.wave != null ? ` (onda ${f.wave})` : ''}: o verify roda ${f.test}${f.via ? ` (o argumento ${f.via} casa como filtro de substring do vitest)` : ''}, que só fica verde com ${f.owner}${f.owner_wave != null ? ` (onda ${f.owner_wave})` : ''} — inalcançável neste ponto da ordem: tire do verify de ${f.task}${f.via ? ' (ou ancore o caminho, ou estreite com -t)' : ''}, ou faça ${f.task} depender de ${f.owner} [G38]`;
|
|
496
|
+
if (mode === 'error') errors.push(line); else warnings.push(line);
|
|
497
|
+
}
|
|
498
|
+
return { errors, warnings };
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function messages(findings, { mode = 'error' } = {}) {
|
|
502
|
+
const errors = [];
|
|
503
|
+
const warnings = [];
|
|
504
|
+
for (const f of findings) {
|
|
505
|
+
for (const s of f.suites) {
|
|
506
|
+
const line = s.level === 'error'
|
|
507
|
+
? `${f.task}: ${s.test} importa ${s.names.join(', ')} de ${f.file} — a tarefa muda essa lista/constante e a suíte afirma sobre ela, mas não está no verify nem no escopo (inclua no verify, ou em files se a tarefa pode ter de mudá-la) [G30]`
|
|
508
|
+
: `${f.task}: ${s.test} importa ${f.file} e não está no verify nem no escopo da tarefa — se a mudança a quebrar, o vermelho fica fora do escopo (inclua no verify) [G30]`;
|
|
509
|
+
if (s.level === 'error' && mode === 'error') errors.push(line);
|
|
510
|
+
else warnings.push(line);
|
|
511
|
+
}
|
|
512
|
+
for (const d of f.data || []) {
|
|
513
|
+
warnings.push(`${f.task}: ${d.test} (que importa ${f.file}) lê ${d.file} — se a tarefa muda o que essa suíte compara (ids, rótulos, uma lista), ${d.file} precisa estar em files da tarefa [G30b]`);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return { errors, warnings };
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* G43 (OxeSpace 15/11, OxeCode F6 T42, US$ 8 in 3 attempts): T42 added a channel to shared/types/ipc.ts, and
|
|
521
|
+
* tests/mcp-coverage.test.ts ("gives every IPC channel a capability") checks it against shared/mcp-coverage.ts, which
|
|
522
|
+
* was not in T42's scope — unpassable at every attempt. Per pending task: a REGISTRY in its scope whose MANIFEST is out
|
|
523
|
+
* of its scope (and its ancestors'), when a repo suite checks both. The pairs: declared (`lint.registry_pairs`:
|
|
524
|
+
* [{ registry, manifest }]) or found — a suite imports the registry and a file that itself imports the registry.
|
|
525
|
+
* @returns {{ task: string, registry: string, manifest: string, suite: string|null, declared: boolean }[]}
|
|
526
|
+
*/
|
|
527
|
+
function registryManifestGaps(root, planDoc, options = {}) {
|
|
528
|
+
const all = (planDoc && Array.isArray(planDoc.tasks) ? planDoc.tasks : []).filter(Boolean);
|
|
529
|
+
const pending = all.filter((t) => !isInactiveTask(t));
|
|
530
|
+
if (!pending.length) return [];
|
|
531
|
+
const testScope = require('./oxe-test-scope.cjs');
|
|
532
|
+
const pb = require('./oxe-plan-build.cjs');
|
|
533
|
+
const byId = new Map(all.map((t) => [t.id, t]));
|
|
534
|
+
const scopeOf = (t) => {
|
|
535
|
+
const out = [];
|
|
536
|
+
const seen = new Set();
|
|
537
|
+
const stack = [t.id];
|
|
538
|
+
while (stack.length) {
|
|
539
|
+
const id = stack.pop();
|
|
540
|
+
if (seen.has(id)) continue;
|
|
541
|
+
seen.add(id);
|
|
542
|
+
const x = byId.get(id);
|
|
543
|
+
if (!x) continue;
|
|
544
|
+
for (const f of x.files || []) { const p = norm(typeof f === 'string' ? f : f && f.path); if (p) out.push(p); }
|
|
545
|
+
for (const d of x.depends_on || x.dependsOn || []) stack.push(d);
|
|
546
|
+
}
|
|
547
|
+
return out;
|
|
548
|
+
};
|
|
549
|
+
const declared = (Array.isArray(options.pairs) ? options.pairs : []).map((p) => ({ registry: norm(p && p.registry), manifest: norm(p && p.manifest) })).filter((p) => p.registry && p.manifest);
|
|
550
|
+
// found pairs: a suite that imports the registry and a manifest which imports the registry too
|
|
551
|
+
let index = null;
|
|
552
|
+
const lazyIndex = () => { if (!index) index = options.index || importIndex(root, options); return index; };
|
|
553
|
+
const read = options.readText || ((f) => { try { return fs.readFileSync(path.join(root, f), 'utf8'); } catch { return ''; } });
|
|
554
|
+
const known = () => new Set(options.files || trackedFiles(root));
|
|
555
|
+
let knownSet = null;
|
|
556
|
+
let aliases = null;
|
|
557
|
+
// R42: VALUE imports only (an `import type` never checks a key at run time), memoized; per target, the names imported
|
|
558
|
+
const memo = new Map();
|
|
559
|
+
const importsOf = (file) => {
|
|
560
|
+
if (memo.has(file)) return memo.get(file);
|
|
561
|
+
if (!knownSet) knownSet = known();
|
|
562
|
+
if (!aliases) aliases = pb.loadPathAliases(root);
|
|
563
|
+
const src = read(file);
|
|
564
|
+
const out = new Map();
|
|
565
|
+
const add = (spec, names, wildcard) => {
|
|
566
|
+
const target = pb.resolveModuleSpecifier(file, spec, knownSet, aliases);
|
|
567
|
+
if (!target) return;
|
|
568
|
+
const cur = out.get(target) || { names: new Set(), wildcard: false };
|
|
569
|
+
for (const n of names) cur.names.add(n);
|
|
570
|
+
if (wildcard) cur.wildcard = true;
|
|
571
|
+
out.set(target, cur);
|
|
572
|
+
};
|
|
573
|
+
for (const m of src.matchAll(/\bimport\s+(type\s+)?([\s\S]*?)\s+from\s*['"]([^'"]+)['"]/g)) {
|
|
574
|
+
if (m[1]) continue;
|
|
575
|
+
const clause = m[2];
|
|
576
|
+
const named = /\{([\s\S]*)\}/.exec(clause);
|
|
577
|
+
const names = named ? named[1].split(',').map((x) => x.trim()).filter((x) => x && !/^type\s/.test(x)).map((x) => x.split(/\s+as\s+/)[0].trim()) : [];
|
|
578
|
+
const wildcard = /\*\s+as\s+/.test(clause) || /^[A-Za-z_$][\w$]*\s*(,|$)/.test(clause.trim());
|
|
579
|
+
if (names.length || wildcard) add(m[3], names, wildcard);
|
|
580
|
+
}
|
|
581
|
+
for (const m of src.matchAll(/\brequire\s*\(\s*['"]([^'"]+)['"]\s*\)/g)) add(m[1], [], true);
|
|
582
|
+
memo.set(file, out);
|
|
583
|
+
return out;
|
|
584
|
+
};
|
|
585
|
+
const constsMemo = new Map();
|
|
586
|
+
const constsOf = (f) => { if (!constsMemo.has(f)) constsMemo.set(f, exportedConstants(read(f))); return constsMemo.get(f); };
|
|
587
|
+
const usesConst = (imp, consts) => Boolean(imp) && consts.size > 0 && (imp.wildcard || [...imp.names].some((n) => consts.has(n)));
|
|
588
|
+
const out = [];
|
|
589
|
+
const seen = new Set();
|
|
590
|
+
for (const t of pending) {
|
|
591
|
+
const own = (t.files || []).map((f) => norm(typeof f === 'string' ? f : f && f.path)).filter(Boolean);
|
|
592
|
+
const scope = scopeOf(t);
|
|
593
|
+
const inScope = (f) => scope.some((s) => testScope.covers(s, f));
|
|
594
|
+
const registries = own.filter((f) => CODE_RE.test(f) && !TEST_RE.test(f));
|
|
595
|
+
const push = (registry, manifest, suite, isDeclared) => {
|
|
596
|
+
const k = `${t.id}\u0000${registry}\u0000${manifest}`;
|
|
597
|
+
if (seen.has(k) || inScope(manifest)) return;
|
|
598
|
+
seen.add(k);
|
|
599
|
+
out.push({ task: t.id, registry, manifest, suite, declared: isDeclared });
|
|
600
|
+
};
|
|
601
|
+
for (const p of declared) if (own.some((f) => testScope.covers(f, p.registry))) push(p.registry, p.manifest, null, true);
|
|
602
|
+
// R42: detection is opt-in (lint.registry_detect: true) — the declared pair is the reliable form (in the real F6
|
|
603
|
+
// case the manifest does not even import the registry). Detected: the suite uses constants of BOTH, the manifest
|
|
604
|
+
// imports the registry by value, and both export constants (types, errors and helpers never count).
|
|
605
|
+
if (options.detect !== true) continue;
|
|
606
|
+
const { byTarget } = lazyIndex();
|
|
607
|
+
for (const registry of registries) {
|
|
608
|
+
const regConsts = constsOf(registry);
|
|
609
|
+
if (!regConsts.size) continue;
|
|
610
|
+
for (const hit of byTarget.get(registry) || []) {
|
|
611
|
+
const suiteImps = importsOf(hit.test);
|
|
612
|
+
if (!usesConst(suiteImps.get(registry), regConsts)) continue;
|
|
613
|
+
for (const [m, imp] of suiteImps) {
|
|
614
|
+
if (m === registry || TEST_RE.test(m) || !CODE_RE.test(m) || inScope(m)) continue;
|
|
615
|
+
if (!usesConst(imp, constsOf(m))) continue;
|
|
616
|
+
if (!importsOf(m).has(registry)) continue;
|
|
617
|
+
push(registry, m, hit.test, false);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return out;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
function registryManifestMessages(found, { level = 'warn' } = {}) {
|
|
626
|
+
const lines = found.map((f) => `${f.task} muda ${f.registry}, e ${f.manifest} fica fora do escopo${f.suite ? ` — ${f.suite} confere um contra o outro` : ' (par declarado em lint.registry_pairs)'}: uma chave nova no registro sem o manifesto não passa nessa suíte em nenhuma tentativa (OxeCode F6 T42) — inclua ${f.manifest} nos files de ${f.task} (ou numa tarefa de que ela dependa) [G43]`);
|
|
627
|
+
return level === 'error' ? { errors: lines, warnings: [] } : { errors: [], warnings: lines };
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
function extractEntryTestFiles(entry) {
|
|
631
|
+
if (!entry || typeof entry !== 'object') return [];
|
|
632
|
+
const out = [];
|
|
633
|
+
for (const f of entry.files || []) {
|
|
634
|
+
const p = norm(typeof f === 'string' ? f : f && f.path);
|
|
635
|
+
if (p) out.push(p);
|
|
636
|
+
}
|
|
637
|
+
if (typeof entry.command === 'string' && entry.command.trim()) {
|
|
638
|
+
for (const m of entry.command.replace(/\\/g, '/').matchAll(/([^\s"'`]+\.(?:test|spec)\.[cm]?[jt]sx?)\$?/gi)) {
|
|
639
|
+
const p = norm(m[1]);
|
|
640
|
+
if (p && p.includes('/')) out.push(p);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
return [...new Set(out)];
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
function extractTaskVerifySpecs(task) {
|
|
647
|
+
const commands = [
|
|
648
|
+
...((task && task.verify && Array.isArray(task.verify.commands)) ? task.verify.commands : []),
|
|
649
|
+
task && task.verify && task.verify.command,
|
|
650
|
+
task && task.verifyCommand,
|
|
651
|
+
].filter(Boolean).map((c) => String(c).replace(/\\/g, '/'));
|
|
652
|
+
const exact = new Set();
|
|
653
|
+
const filters = new Set();
|
|
654
|
+
for (const sub of commands.flatMap((c) => c.split(/\s*(?:&&|\|\||;)\s*/)).filter(Boolean)) {
|
|
655
|
+
const narrowed = /(^|\s)(-t|--testNamePattern|--grep|-g)(\s|=)/.test(sub);
|
|
656
|
+
const exactRunner = /\bnode\b[^|;&]*\s--test(\s|=|$)/.test(sub);
|
|
657
|
+
for (const raw of sub.match(/[^\s"'`]+/g) || []) {
|
|
658
|
+
const anchored = raw.endsWith('$');
|
|
659
|
+
const cleaned = norm(anchored ? raw.slice(0, -1) : raw);
|
|
660
|
+
if (!cleaned || cleaned.startsWith('-')) continue;
|
|
661
|
+
if (cleaned.includes('/') && TEST_RE.test(cleaned) && /\.[cm]?[jt]sx?$/i.test(cleaned)) {
|
|
662
|
+
exact.add(cleaned);
|
|
663
|
+
if (!narrowed && !anchored && !exactRunner) filters.add(cleaned);
|
|
664
|
+
} else if (!narrowed && !exactRunner && /^[A-Za-z0-9][\w./-]{5,}$/.test(cleaned) && !/\.(?:mjs|cjs|js|json)$/i.test(cleaned)) {
|
|
665
|
+
// e.g. `vitest run ag04d-changes-badge` or `vitest run tests/oxe152/ag/ag04d-changes-badge`
|
|
666
|
+
filters.add(cleaned);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
return { exact, filters };
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
function canonicalRepoTestPath(rawFile, knownPaths, projectRoot) {
|
|
674
|
+
let f = norm(rawFile);
|
|
675
|
+
if (!f) return '';
|
|
676
|
+
if (knownPaths.has(f)) return f;
|
|
677
|
+
if (projectRoot && path.isAbsolute(String(rawFile || ''))) {
|
|
678
|
+
const rel = norm(path.relative(projectRoot, String(rawFile)));
|
|
679
|
+
if (rel && !rel.startsWith('..') && (knownPaths.has(rel) || fs.existsSync(path.join(projectRoot, rel)))) return rel;
|
|
680
|
+
}
|
|
681
|
+
for (const k of knownPaths) {
|
|
682
|
+
if (f.endsWith(`/${k}`)) return k;
|
|
683
|
+
}
|
|
684
|
+
if (projectRoot && f.includes('/')) {
|
|
685
|
+
const parts = f.split('/').filter(Boolean);
|
|
686
|
+
for (let i = 1; i < parts.length - 1; i += 1) {
|
|
687
|
+
const suffix = parts.slice(i).join('/');
|
|
688
|
+
if (TEST_RE.test(suffix) && fs.existsSync(path.join(projectRoot, suffix))) return suffix;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
return f;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* OXB-C3 (OxeSpace 16/11, F6 T39 wave 14): applies G38 (`laterOwnedTests` / `plan verify prune --later-owned`) to the
|
|
696
|
+
* failing list of `checkpoint_related_tests` (`vitest related`), separating frozen tests of pending later tasks (e.g.
|
|
697
|
+
* `ag04d-changes-badge` → T43, `ag04c-pin-a11y` → T41, `pu03-first-run-forced` → T54) and superseded/parked tests from
|
|
698
|
+
* candidate regressions of `taskId`.
|
|
699
|
+
*/
|
|
700
|
+
function classifyRelatedTestFiles(planDoc, taskId, failingItems, options = {}) {
|
|
701
|
+
const items = Array.isArray(failingItems)
|
|
702
|
+
? failingItems.map((it) => (typeof it === 'string' ? { file: it, names: [] } : { file: it && it.file, names: Array.isArray(it && it.names) ? it.names : [] })).filter((it) => it.file)
|
|
703
|
+
: [];
|
|
704
|
+
if (!items.length) return { candidates: [], later_owned: [], other_ignored: [] };
|
|
705
|
+
|
|
706
|
+
const allTasks = (planDoc && Array.isArray(planDoc.tasks) ? planDoc.tasks : []).filter(Boolean);
|
|
707
|
+
const activeOrDone = allTasks.filter((t) => !isSupersededTask(t));
|
|
708
|
+
const byId = new Map(activeOrDone.map((t) => [String(t.id).toUpperCase(), t]));
|
|
709
|
+
const normTaskId = taskId ? String(taskId).trim().toUpperCase() : null;
|
|
710
|
+
const curTask = normTaskId ? byId.get(normTaskId) : null;
|
|
711
|
+
const curOwnFiles = new Set(((curTask && curTask.files) || []).map((f) => norm(typeof f === 'string' ? f : f && f.path)).filter(Boolean));
|
|
712
|
+
const waveOf = (t) => (t && Number.isFinite(Number(t.wave)) ? Number(t.wave) : null);
|
|
713
|
+
|
|
714
|
+
const knownPaths = new Set();
|
|
715
|
+
const supersededMap = new Map();
|
|
716
|
+
for (const s of (planDoc && Array.isArray(planDoc.superseded_tests) ? planDoc.superseded_tests : [])) {
|
|
717
|
+
if (!s) continue;
|
|
718
|
+
const owner = (s.superseded && s.superseded.by_phase) || 'fase-posterior';
|
|
719
|
+
for (const p of extractEntryTestFiles(s)) {
|
|
720
|
+
knownPaths.add(p);
|
|
721
|
+
supersededMap.set(p, { owner, criterion: s.criterion || null });
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
const explicitOwners = new Map(); // file → { ids: Set, criteria: Set, declaredTasks: Set, frozenOwners: Set }
|
|
726
|
+
const ensureExplicit = (p) => {
|
|
727
|
+
knownPaths.add(p);
|
|
728
|
+
if (!explicitOwners.has(p)) explicitOwners.set(p, { ids: new Set(), criteria: new Set(), declaredTasks: new Set(), frozenOwners: new Set() });
|
|
729
|
+
return explicitOwners.get(p);
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
const acceptList = [
|
|
733
|
+
...((planDoc && Array.isArray(planDoc.acceptance_tests)) ? planDoc.acceptance_tests : []),
|
|
734
|
+
...((planDoc && Array.isArray(planDoc.acceptanceTests)) ? planDoc.acceptanceTests : []),
|
|
735
|
+
];
|
|
736
|
+
for (const a of acceptList) {
|
|
737
|
+
if (!a) continue;
|
|
738
|
+
const declaredTask = a.task ? String(a.task).trim().toUpperCase() : null;
|
|
739
|
+
const matched = declaredTask
|
|
740
|
+
? activeOrDone.filter((t) => String(t.id).toUpperCase() === declaredTask)
|
|
741
|
+
: activeOrDone.filter((t) => criterionMatches(taskCriteriaOf(t), a.criterion));
|
|
742
|
+
for (const p of extractEntryTestFiles(a)) {
|
|
743
|
+
const rec = ensureExplicit(p);
|
|
744
|
+
if (a.criterion) rec.criteria.add(String(a.criterion));
|
|
745
|
+
if (declaredTask) rec.declaredTasks.add(declaredTask);
|
|
746
|
+
for (const t of matched) {
|
|
747
|
+
const uid = String(t.id).toUpperCase();
|
|
748
|
+
rec.ids.add(uid);
|
|
749
|
+
rec.frozenOwners.add(uid);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
for (const t of activeOrDone) {
|
|
755
|
+
const uid = String(t.id).toUpperCase();
|
|
756
|
+
for (const f of t.files || []) {
|
|
757
|
+
const p = norm(typeof f === 'string' ? f : f && f.path);
|
|
758
|
+
if (p) knownPaths.add(p);
|
|
759
|
+
if (p && TEST_RE.test(p) && ACCEPT_OR_FROZEN_DIR_RE.test(p)) {
|
|
760
|
+
const rec = ensureExplicit(p);
|
|
761
|
+
rec.ids.add(uid);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
const verifySpecsByTask = new Map();
|
|
767
|
+
for (const t of activeOrDone) {
|
|
768
|
+
const spec = extractTaskVerifySpecs(t);
|
|
769
|
+
for (const p of spec.exact) knownPaths.add(p);
|
|
770
|
+
verifySpecsByTask.set(String(t.id).toUpperCase(), { task: t, ...spec });
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
const resolveVerifyOwnersForFrozen = (file) => {
|
|
774
|
+
const exactIds = [];
|
|
775
|
+
for (const [uid, spec] of verifySpecsByTask) {
|
|
776
|
+
if (spec.exact.has(file)) exactIds.push(uid);
|
|
777
|
+
}
|
|
778
|
+
if (exactIds.length) return exactIds;
|
|
779
|
+
const stem = path.posix.basename(file).replace(/\.(test|spec)\.[cm]?[jt]sx?$/i, '').replace(/\.[cm]?[jt]sx?$/i, '');
|
|
780
|
+
const filterIds = [];
|
|
781
|
+
for (const [uid, spec] of verifySpecsByTask) {
|
|
782
|
+
for (const flt of spec.filters) {
|
|
783
|
+
if (file.includes(flt) || (stem.length >= 6 && flt === stem)) {
|
|
784
|
+
filterIds.push(uid);
|
|
785
|
+
break;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return filterIds;
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
const candidates = [];
|
|
793
|
+
const laterOwned = [];
|
|
794
|
+
const otherIgnored = [];
|
|
795
|
+
|
|
796
|
+
for (const rawItem of items) {
|
|
797
|
+
const file = canonicalRepoTestPath(rawItem.file, knownPaths, options.projectRoot || null);
|
|
798
|
+
const item = { ...rawItem, file };
|
|
799
|
+
if (PARKED_DIR_RE.test(file)) {
|
|
800
|
+
otherIgnored.push({ file, names: item.names, owner: 'parked', reason: 'parked' });
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
const exp = explicitOwners.get(file);
|
|
805
|
+
if (exp) {
|
|
806
|
+
const ids = [...exp.ids];
|
|
807
|
+
// G38 cross-review rule: if curTask writes a mutable acceptance file (in its own files) and no later task holds it
|
|
808
|
+
// as a frozen acceptance_tests entry, curTask runs it itself; if a later pending task holds it as frozen, later wins.
|
|
809
|
+
const frozenPendingLater = [...exp.frozenOwners].filter((id) => id !== normTaskId && !isDoneTask(byId.get(id)));
|
|
810
|
+
if (normTaskId && ids.includes(normTaskId) && (!frozenPendingLater.length || exp.frozenOwners.has(normTaskId) || curOwnFiles.has(file))) {
|
|
811
|
+
if (!frozenPendingLater.length || exp.frozenOwners.has(normTaskId)) {
|
|
812
|
+
candidates.push(item);
|
|
813
|
+
continue;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
if (ids.length > 0 && ids.every((id) => isDoneTask(byId.get(id)))) {
|
|
817
|
+
candidates.push(item);
|
|
818
|
+
continue;
|
|
819
|
+
}
|
|
820
|
+
const pendingIds = ids.filter((id) => id !== normTaskId && !isDoneTask(byId.get(id)));
|
|
821
|
+
const firstOwner = pendingIds.length ? byId.get(pendingIds[0]) : null;
|
|
822
|
+
const criterion = exp.criteria.size ? [...exp.criteria][0] : null;
|
|
823
|
+
const ownerLabel = pendingIds.length
|
|
824
|
+
? pendingIds.map((id) => (byId.get(id) ? byId.get(id).id : id)).join(', ')
|
|
825
|
+
: ([...exp.declaredTasks][0] || (criterion ? `critério ${criterion}` : 'outra-fase'));
|
|
826
|
+
laterOwned.push({
|
|
827
|
+
file,
|
|
828
|
+
names: item.names,
|
|
829
|
+
owner: ownerLabel,
|
|
830
|
+
owner_wave: waveOf(firstOwner),
|
|
831
|
+
...(criterion ? { criterion } : {}),
|
|
832
|
+
});
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
if (supersededMap.has(file)) {
|
|
837
|
+
const sup = supersededMap.get(file);
|
|
838
|
+
laterOwned.push({
|
|
839
|
+
file,
|
|
840
|
+
names: item.names,
|
|
841
|
+
owner: sup.owner,
|
|
842
|
+
owner_wave: null,
|
|
843
|
+
...(sup.criterion ? { criterion: sup.criterion } : {}),
|
|
844
|
+
});
|
|
845
|
+
continue;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
if (ACCEPT_OR_FROZEN_DIR_RE.test(file)) {
|
|
849
|
+
const vIds = resolveVerifyOwnersForFrozen(file);
|
|
850
|
+
if (vIds.length > 0) {
|
|
851
|
+
if (normTaskId && vIds.includes(normTaskId)) {
|
|
852
|
+
candidates.push(item);
|
|
853
|
+
continue;
|
|
854
|
+
}
|
|
855
|
+
if (vIds.every((id) => isDoneTask(byId.get(id)))) {
|
|
856
|
+
candidates.push(item);
|
|
857
|
+
continue;
|
|
858
|
+
}
|
|
859
|
+
const pendingIds = vIds.filter((id) => id !== normTaskId && !isDoneTask(byId.get(id)));
|
|
860
|
+
const firstOwner = pendingIds.length ? byId.get(pendingIds[0]) : null;
|
|
861
|
+
laterOwned.push({
|
|
862
|
+
file,
|
|
863
|
+
names: item.names,
|
|
864
|
+
owner: pendingIds.map((id) => (byId.get(id) ? byId.get(id).id : id)).join(', '),
|
|
865
|
+
owner_wave: waveOf(firstOwner),
|
|
866
|
+
});
|
|
867
|
+
continue;
|
|
868
|
+
}
|
|
869
|
+
if (/(?:^|\/)acceptance\//i.test(file)) {
|
|
870
|
+
otherIgnored.push({ file, names: item.names, owner: 'outra-fase', reason: 'other_phase_acceptance' });
|
|
871
|
+
continue;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
candidates.push(item);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
return { candidates, later_owned: laterOwned, other_ignored: otherIgnored };
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* OXB-C3: returns all Vitest-runnable frozen/acceptance test paths owned by pending later tasks, superseded_tests or
|
|
883
|
+
* unowned criteria relative to `taskId`, so `relatedTestsCommand` can proactively pass `--exclude <path>` to Vitest
|
|
884
|
+
* before running `vitest related --run`.
|
|
885
|
+
*/
|
|
886
|
+
function laterOwnedExcludesForTask(planDoc, taskId) {
|
|
887
|
+
if (!planDoc || typeof planDoc !== 'object') return [];
|
|
888
|
+
const isE2e = (f) => /(^|\/)(e2e|playwright)\//i.test(f) || /\.e2e\.[cm]?[jt]sx?$/i.test(f);
|
|
889
|
+
const allFrozenCandidates = new Set();
|
|
890
|
+
for (const a of [
|
|
891
|
+
...(Array.isArray(planDoc.acceptance_tests) ? planDoc.acceptance_tests : []),
|
|
892
|
+
...(Array.isArray(planDoc.acceptanceTests) ? planDoc.acceptanceTests : []),
|
|
893
|
+
...(Array.isArray(planDoc.superseded_tests) ? planDoc.superseded_tests : []),
|
|
894
|
+
]) {
|
|
895
|
+
for (const p of extractEntryTestFiles(a)) {
|
|
896
|
+
if (p && TEST_RE.test(p) && !isE2e(p)) allFrozenCandidates.add(p);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
for (const t of (Array.isArray(planDoc.tasks) ? planDoc.tasks : [])) {
|
|
900
|
+
if (isSupersededTask(t)) continue;
|
|
901
|
+
for (const f of t.files || []) {
|
|
902
|
+
const p = norm(typeof f === 'string' ? f : f && f.path);
|
|
903
|
+
if (p && TEST_RE.test(p) && ACCEPT_OR_FROZEN_DIR_RE.test(p) && !isE2e(p)) allFrozenCandidates.add(p);
|
|
904
|
+
}
|
|
905
|
+
const spec = extractTaskVerifySpecs(t);
|
|
906
|
+
for (const p of spec.exact) {
|
|
907
|
+
if (p && ACCEPT_OR_FROZEN_DIR_RE.test(p) && !isE2e(p)) allFrozenCandidates.add(p);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
if (!allFrozenCandidates.size) return [];
|
|
911
|
+
const classified = classifyRelatedTestFiles(planDoc, taskId || null, [...allFrozenCandidates]);
|
|
912
|
+
return [...new Set([...classified.later_owned, ...classified.other_ignored].map((x) => x.file))];
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* OXB-C6 #6: Detects when frozen acceptance tests live in a config or directory (e.g. `playwright.acceptance.config.ts`,
|
|
917
|
+
* `tests/acceptance/`, `e2e/acceptance/`) that NO `package.json` script and NO job in `.github/workflows/*.yml` executes.
|
|
918
|
+
*/
|
|
919
|
+
function findUnrunFrozenAcceptanceCi(projectRoot, planDoc = null, options = {}) {
|
|
920
|
+
const readFile = options.readText || ((rel) => {
|
|
921
|
+
try { return fs.readFileSync(path.join(projectRoot, rel), 'utf8'); } catch { return null; }
|
|
922
|
+
});
|
|
923
|
+
let pkg = null;
|
|
924
|
+
try {
|
|
925
|
+
const rawPkg = readFile('package.json');
|
|
926
|
+
if (rawPkg) pkg = JSON.parse(rawPkg);
|
|
927
|
+
} catch { pkg = null; }
|
|
928
|
+
const scripts = pkg && pkg.scripts && typeof pkg.scripts === 'object' ? pkg.scripts : {};
|
|
929
|
+
const scriptEntries = Object.entries(scripts).filter(([, cmd]) => typeof cmd === 'string' && cmd.trim());
|
|
930
|
+
|
|
931
|
+
const wfDir = path.join(projectRoot, '.github', 'workflows');
|
|
932
|
+
const workflowFiles = [];
|
|
933
|
+
if (fs.existsSync(wfDir)) {
|
|
934
|
+
try {
|
|
935
|
+
for (const name of fs.readdirSync(wfDir).sort()) {
|
|
936
|
+
if (/\.ya?ml$/i.test(name)) workflowFiles.push(`.github/workflows/${name}`);
|
|
937
|
+
}
|
|
938
|
+
} catch { /* ignore */ }
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// Bare synthetic test fixtures with neither package scripts nor CI workflows have nothing to audit against
|
|
942
|
+
if (!scriptEntries.length && !workflowFiles.length) return [];
|
|
943
|
+
|
|
944
|
+
const allTracked = options.files || trackedFiles(projectRoot);
|
|
945
|
+
const acceptEntries = [
|
|
946
|
+
...(planDoc && Array.isArray(planDoc.acceptance_tests) ? planDoc.acceptance_tests : []),
|
|
947
|
+
...(planDoc && Array.isArray(planDoc.acceptanceTests) ? planDoc.acceptanceTests : []),
|
|
948
|
+
];
|
|
949
|
+
|
|
950
|
+
// 1. Discover frozen acceptance config files and acceptance test directories
|
|
951
|
+
const configsMap = new Map(); // relConfig -> { runner, files: Set, dirs: Set }
|
|
952
|
+
const dirsMap = new Map(); // relDir -> { runner, files: Set }
|
|
953
|
+
const addConfig = (cfgPath, runner = 'unknown', file = null, dirRel = null) => {
|
|
954
|
+
const c = norm(cfgPath);
|
|
955
|
+
if (!c || /(^|\/)parked[^/]*\//i.test(c)) return;
|
|
956
|
+
if (!configsMap.has(c)) configsMap.set(c, { runner, files: new Set(), dirs: new Set() });
|
|
957
|
+
const entry = configsMap.get(c);
|
|
958
|
+
if (runner !== 'unknown' && entry.runner === 'unknown') entry.runner = runner;
|
|
959
|
+
if (file) entry.files.add(norm(file));
|
|
960
|
+
if (dirRel) entry.dirs.add(norm(dirRel).replace(/\/+$/, '') + '/');
|
|
961
|
+
};
|
|
962
|
+
const addDir = (dirRel, runner = 'unknown', file = null) => {
|
|
963
|
+
const d = norm(dirRel).replace(/\/+$/, '') + '/';
|
|
964
|
+
if (!d || d === '/' || /(^|\/)parked[^/]*\//i.test(d)) return;
|
|
965
|
+
if (!dirsMap.has(d)) dirsMap.set(d, { runner, files: new Set() });
|
|
966
|
+
const entry = dirsMap.get(d);
|
|
967
|
+
if (runner !== 'unknown' && entry.runner === 'unknown') entry.runner = runner;
|
|
968
|
+
if (file) entry.files.add(norm(file));
|
|
969
|
+
};
|
|
970
|
+
const inferRunner = (cmdOrPath, fileText) => {
|
|
971
|
+
const s = `${cmdOrPath || ''}\n${fileText || ''}`;
|
|
972
|
+
if (/\bnode\s+--test\b|require\(['"]node:test['"]\)|from\s+['"]node:test['"]/i.test(s)) return 'node-test';
|
|
973
|
+
if (/\bplaywright\b|@playwright\/test/i.test(s)) return 'playwright';
|
|
974
|
+
if (/\bvitest\b|from\s+['"]vitest['"]/i.test(s)) return 'vitest';
|
|
975
|
+
if (/\bjest\b/i.test(s)) return 'jest';
|
|
976
|
+
if (/\.e2e\.|\.spec\.[cm]?[jt]sx?$/i.test(String(cmdOrPath || '')) && !/\bvitest\b/i.test(s)) return 'playwright';
|
|
977
|
+
return 'unknown';
|
|
978
|
+
};
|
|
979
|
+
const acceptanceFolderFor = (rel) => {
|
|
980
|
+
const f = norm(rel);
|
|
981
|
+
if (/(^|\/)parked[^/]*\//i.test(f)) return null;
|
|
982
|
+
const m = /^((?:[^/]+\/)*acceptance)(?:\/|$)/i.exec(f);
|
|
983
|
+
if (m) return `${m[1]}/`;
|
|
984
|
+
return null;
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
for (const a of acceptEntries) {
|
|
988
|
+
if (!a || typeof a !== 'object') continue;
|
|
989
|
+
const cmd = typeof a.command === 'string' ? a.command : '';
|
|
990
|
+
const aFiles = extractEntryTestFiles(a).filter((f) => !/(^|\/)parked[^/]*\//i.test(f));
|
|
991
|
+
const cfgM = /(?:^|\s)(?:-c|--config(?:=|\s+))["']?([^\s"']+)["']?/.exec(cmd);
|
|
992
|
+
const aFolders = aFiles.map((f) => acceptanceFolderFor(f)).filter(Boolean);
|
|
993
|
+
if (cfgM) addConfig(cfgM[1], inferRunner(cmd, ''), aFiles[0] || null, aFolders[0] || null);
|
|
994
|
+
for (const f of aFiles) {
|
|
995
|
+
const folder = acceptanceFolderFor(f);
|
|
996
|
+
if (folder) {
|
|
997
|
+
const txt = readFile(f) || '';
|
|
998
|
+
addDir(folder, inferRunner(cmd || f, txt), f);
|
|
999
|
+
if (cfgM) addConfig(cfgM[1], inferRunner(cmd, ''), f, folder);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
for (const f of allTracked) {
|
|
1005
|
+
const rel = norm(f);
|
|
1006
|
+
if (!rel || /(^|\/)parked[^/]*\//i.test(rel)) continue;
|
|
1007
|
+
if (/^(?:playwright|vitest|jest)\.[^/]*acceptance[^/]*\.config\.[cm]?[jt]s$/i.test(path.posix.basename(rel))) {
|
|
1008
|
+
const cfgBody = readFile(rel) || '';
|
|
1009
|
+
const tdMatch = /testDir\s*:\s*['"](?:\.\/)?([^'"]+)['"]/.exec(cfgBody);
|
|
1010
|
+
addConfig(rel, inferRunner(rel, cfgBody), null, tdMatch ? tdMatch[1] : null);
|
|
1011
|
+
}
|
|
1012
|
+
if (TEST_RE.test(rel)) {
|
|
1013
|
+
const folder = acceptanceFolderFor(rel);
|
|
1014
|
+
if (folder) {
|
|
1015
|
+
addDir(folder, inferRunner(rel, readFile(rel) || ''), rel);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
if (!configsMap.size && !dirsMap.size) return [];
|
|
1021
|
+
|
|
1022
|
+
// Read workflow YAML contents (strip `# ...` comments line-by-line)
|
|
1023
|
+
const workflows = workflowFiles.map((wf) => {
|
|
1024
|
+
const raw = readFile(wf) || '';
|
|
1025
|
+
const clean = raw
|
|
1026
|
+
.split(/\r?\n/)
|
|
1027
|
+
.filter((line) => !/^\s*#/.test(line))
|
|
1028
|
+
.join('\n');
|
|
1029
|
+
return { file: wf, text: clean };
|
|
1030
|
+
});
|
|
1031
|
+
|
|
1032
|
+
// Read root vitest/playwright configs once to avoid false positives when a root runner excludes/overrides acceptance dirs
|
|
1033
|
+
const vitestCfgText = ['vitest.config.ts', 'vitest.config.mts', 'vitest.config.js', 'vitest.config.mjs', 'vitest.config.cjs']
|
|
1034
|
+
.map((c) => readFile(c))
|
|
1035
|
+
.find(Boolean) || '';
|
|
1036
|
+
const pwCfgText = ['playwright.config.ts', 'playwright.config.mts', 'playwright.config.js', 'playwright.config.mjs']
|
|
1037
|
+
.map((c) => readFile(c))
|
|
1038
|
+
.find(Boolean) || '';
|
|
1039
|
+
|
|
1040
|
+
const textCoversTarget = (cmdText, target, isConfig, runner) => {
|
|
1041
|
+
const cleanTarget = norm(target).replace(/\/+$/, '');
|
|
1042
|
+
const esc = cleanTarget.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
1043
|
+
// Explicit path/config reference or `tests/acceptance` / `e2e/acceptance` substring match
|
|
1044
|
+
if (new RegExp(`(?:^|[\\s"'=/:])${esc}(?:$|[/\\s"'])`, 'i').test(cmdText)) return true;
|
|
1045
|
+
const base = path.posix.basename(cleanTarget);
|
|
1046
|
+
if (isConfig && new RegExp(`(?:-c|--config(?:=|\\s+))["']?(?:\\./)?${base.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}`, 'i').test(cmdText)) {
|
|
1047
|
+
return true;
|
|
1048
|
+
}
|
|
1049
|
+
if (!isConfig) {
|
|
1050
|
+
// Bare runner command without explicit path/config filter: check if default config covers this folder
|
|
1051
|
+
const hasPwCfgFile = [...configsMap.keys()].some((c) => /playwright/i.test(c));
|
|
1052
|
+
if ((runner === 'playwright' || /^e2e\//i.test(cleanTarget)) && /\bplaywright\s+test\b/i.test(cmdText)) {
|
|
1053
|
+
const filteredElsewhere = /\bplaywright\s+test\b[^\n;|&]*(?:\s(?:-c|--config)|\s(?:e2e|tests)\/)/i.test(cmdText);
|
|
1054
|
+
if (!filteredElsewhere && !hasPwCfgFile && (!pwCfgText || pwCfgText.includes(cleanTarget))) return true;
|
|
1055
|
+
}
|
|
1056
|
+
if ((runner === 'vitest' || runner === 'unknown') && !/^e2e\//i.test(cleanTarget) && /\bvitest(?:\s+run)?\b/i.test(cmdText)) {
|
|
1057
|
+
// If `vitest run <specificPath>` targets e.g. `tests/unit`, it does NOT cover `tests/acceptance`
|
|
1058
|
+
const explicitPaths = [...cmdText.matchAll(/\bvitest(?:\s+run)?\s+([^\n;|&]+)/gi)]
|
|
1059
|
+
.flatMap((m) => m[1].replace(/(?:^|\s)(?:-c|--config(?:=|\s+))["']?[^\s"']+["']?/gi, ' ').trim().split(/\s+/))
|
|
1060
|
+
.filter((tok) => tok && !tok.startsWith('-'));
|
|
1061
|
+
const excludesInCfg = vitestCfgText && new RegExp(`exclude[^\\]]*${esc}`, 'is').test(vitestCfgText);
|
|
1062
|
+
if (!explicitPaths.length && !excludesInCfg && !hasPwCfgFile) return true;
|
|
1063
|
+
if (explicitPaths.some((p) => cleanTarget.startsWith(norm(p).replace(/\/+$/, '')))) return true;
|
|
1064
|
+
}
|
|
1065
|
+
if ((runner === 'node-test' || runner === 'unknown') && /\bnode\s+--test\b/i.test(cmdText)) {
|
|
1066
|
+
const cleanParent = path.posix.dirname(cleanTarget);
|
|
1067
|
+
if (cleanParent && cleanParent !== '.' && new RegExp(`(?:^|[\\s"'=/:])${cleanParent.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?:$|[/\\s"'])`, 'i').test(cmdText)) {
|
|
1068
|
+
return true;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
// OXB-222-07: inspect local Node test runner scripts invoked by package.json (e.g. `node scripts/quality-check.cjs test-root`)
|
|
1072
|
+
for (const m of cmdText.matchAll(/\bnode\s+["']?([^\s"']+\.[cm]?js)["']?/gi)) {
|
|
1073
|
+
const scriptRel = norm(m[1]);
|
|
1074
|
+
const scriptText = readFile(scriptRel);
|
|
1075
|
+
if (scriptText && new RegExp(`(?:^|[\\s"'=/:\\\\])${esc}(?:$|[/\\s"'\\\\])`, 'i').test(scriptText.replace(/\\/g, '/'))) {
|
|
1076
|
+
return true;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
return false;
|
|
1081
|
+
};
|
|
1082
|
+
|
|
1083
|
+
const scriptCallsTarget = new Map(); // scriptName -> boolean (resolved recursively max depth 3 for wrapper scripts)
|
|
1084
|
+
const matchesViaScript = (name, target, isConfig, runner, seen = new Set()) => {
|
|
1085
|
+
if (seen.has(name)) return false;
|
|
1086
|
+
seen.add(name);
|
|
1087
|
+
const body = scripts[name];
|
|
1088
|
+
if (typeof body !== 'string') return false;
|
|
1089
|
+
if (textCoversTarget(body, target, isConfig, runner)) return true;
|
|
1090
|
+
for (const m of body.matchAll(/\b(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?([a-zA-Z0-9:_-]+)\b/g)) {
|
|
1091
|
+
if (m[1] === 'install' || m[1] === 'ci') continue;
|
|
1092
|
+
if (matchesViaScript(m[1], target, isConfig, runner, seen)) return true;
|
|
1093
|
+
}
|
|
1094
|
+
return false;
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1097
|
+
const findings = [];
|
|
1098
|
+
const evalTarget = (target, info, kind) => {
|
|
1099
|
+
const isConfig = kind === 'config';
|
|
1100
|
+
const matchingScripts = scriptEntries
|
|
1101
|
+
.filter(([name]) => matchesViaScript(name, target, isConfig, info.runner))
|
|
1102
|
+
.map(([name]) => name);
|
|
1103
|
+
scriptCallsTarget.set(target, matchingScripts);
|
|
1104
|
+
|
|
1105
|
+
const coveredByWorkflow = workflows.some((wf) => {
|
|
1106
|
+
if (textCoversTarget(wf.text, target, isConfig, info.runner)) return true;
|
|
1107
|
+
return matchingScripts.some((sn) => {
|
|
1108
|
+
const snEsc = sn.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
1109
|
+
if (sn === 'test') return /\b(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?test\b/i.test(wf.text);
|
|
1110
|
+
return new RegExp(`\\b(?:npm|pnpm|yarn|bun)\\s+(?:run\\s+)?${snEsc}\\b`, 'i').test(wf.text);
|
|
1111
|
+
});
|
|
1112
|
+
});
|
|
1113
|
+
|
|
1114
|
+
if (workflows.length && !coveredByWorkflow) {
|
|
1115
|
+
findings.push({
|
|
1116
|
+
target,
|
|
1117
|
+
kind,
|
|
1118
|
+
runner: info.runner,
|
|
1119
|
+
files_count: info.files.size,
|
|
1120
|
+
sample_files: [...info.files].slice(0, 3),
|
|
1121
|
+
in_package_scripts: matchingScripts,
|
|
1122
|
+
in_workflows: false,
|
|
1123
|
+
});
|
|
1124
|
+
} else if (!workflows.length && scriptEntries.length && !matchingScripts.length) {
|
|
1125
|
+
findings.push({
|
|
1126
|
+
target,
|
|
1127
|
+
kind,
|
|
1128
|
+
runner: info.runner,
|
|
1129
|
+
files_count: info.files.size,
|
|
1130
|
+
sample_files: [...info.files].slice(0, 3),
|
|
1131
|
+
in_package_scripts: [],
|
|
1132
|
+
in_workflows: false,
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
for (const [cfg, info] of configsMap.entries()) evalTarget(cfg, info, 'config');
|
|
1138
|
+
for (const [dirRel, info] of dirsMap.entries()) {
|
|
1139
|
+
// If an explicit acceptance config covers this directory (either reported unrun OR verified covered in CI/scripts), skip redundant dir entry
|
|
1140
|
+
const assocConfigs = [...configsMap.entries()].filter(([, cfgInfo]) => cfgInfo.dirs.has(dirRel));
|
|
1141
|
+
if (assocConfigs.length > 0) continue;
|
|
1142
|
+
const coveredByReportedCfg = [...configsMap.keys()].some((c) => findings.some((f) => f.target === c) && info.runner === (configsMap.get(c) || {}).runner);
|
|
1143
|
+
if (coveredByReportedCfg) continue;
|
|
1144
|
+
evalTarget(dirRel, info, 'dir');
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
return findings;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
function unrunFrozenAcceptanceCiMessages(findings) {
|
|
1151
|
+
return (findings || []).map((f) => {
|
|
1152
|
+
const scopeHint = f.sample_files && f.sample_files.length ? ` (ex.: ${f.sample_files.slice(0, 2).join(', ')})` : '';
|
|
1153
|
+
if (f.in_package_scripts && f.in_package_scripts.length) {
|
|
1154
|
+
return `testes de aceite em \`${f.target}\`${scopeHint} têm script em package.json (${f.in_package_scripts.join(', ')}), mas nenhum job em \`.github/workflows/*.yml\` o executa — adicione ao workflow de CI ou estes testes nunca rodam no merge`;
|
|
1155
|
+
}
|
|
1156
|
+
return `testes de aceite congelados em \`${f.target}\`${scopeHint} nunca rodam no CI: nenhum script em \`package.json\` nem job em \`.github/workflows/*.yml\` executa essa config/pasta`;
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
module.exports = { suiteImpact, messages, laterOwnedTests, laterOwnedMessages, classifyRelatedTestFiles, laterOwnedExcludesForTask, findUnrunFrozenAcceptanceCi, unrunFrozenAcceptanceCiMessages, criterionMatches, pinnedByExisting, pinnedMessages, registryManifestGaps, registryManifestMessages, importIndex, exportedConstants, trackedFiles, dataFilesOf, TEST_RE };
|