@routinecrew/routinecode 2.31.77 → 2.31.86
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/README.md +2 -2
- package/bin/cli.sh +23 -0
- package/bin/prompt-vault.dat +1 -0
- package/bin/prompt-vault.js +51 -1
- package/bin/rc-board.js +58 -0
- package/bin/rc-config.js +756 -1
- package/bin/rc-credit-turn.js +2 -1
- package/bin/rc-grant.js +2 -1
- package/bin/rc-login.js +2 -0
- package/bin/rc-map.js +132 -0
- package/bin/rc-privacy.js +200 -0
- package/bin/rc-skills.js +31 -0
- package/bin/rc-team.js +2 -1
- package/bin/setup.js +4 -0
- package/hooks/cc-compat-watch.js +2 -1
- package/hooks/claim-questions.json +40 -0
- package/hooks/hooks-config.json +108 -1
- package/hooks/lib/agent_budget.py +122 -0
- package/hooks/lib/agent_telemetry.py +143 -0
- package/hooks/lib/attest_reader.py +15 -6
- package/hooks/lib/attribution_judge.py +109 -0
- package/hooks/lib/board-golden.json +268 -0
- package/hooks/lib/board.py +503 -0
- package/hooks/lib/board_sync.py +535 -0
- package/hooks/lib/cc-surface.json +1 -1
- package/hooks/lib/claim_structure.py +412 -0
- package/hooks/lib/completion_log.py +12 -5
- package/hooks/lib/config_bash_track.py +114 -28
- package/hooks/lib/config_guard.py +137 -5
- package/hooks/lib/edit_tracker.py +182 -0
- package/hooks/lib/error_line.py +94 -0
- package/hooks/lib/escalation_restore.py +66 -0
- package/hooks/lib/i18n.py +37 -15
- package/hooks/lib/knowledge_items.py +1407 -0
- package/hooks/lib/knowledge_scope.py +123 -0
- package/hooks/lib/known_solution.py +37 -9
- package/hooks/lib/log_compact.py +85 -0
- package/hooks/lib/metacog_signals.py +228 -0
- package/hooks/lib/orch_decision.py +690 -0
- package/hooks/lib/premise-golden.json +96 -0
- package/hooks/lib/presence.py +10 -3
- package/hooks/lib/privacy_log.py +35 -0
- package/hooks/lib/receipt.py +137 -14
- package/hooks/lib/review_gate.py +83 -0
- package/hooks/lib/routine_skill_eval.py +213 -0
- package/hooks/lib/secret_filter.py +2 -1
- package/hooks/lib/skill_drafts.py +188 -0
- package/hooks/lib/sync_manager.py +121 -26
- package/hooks/lib/usage_v2.py +680 -0
- package/hooks/lib/work_kind.py +198 -0
- package/hooks/lib/work_kind_events.py +361 -0
- package/hooks/pending-drainer.sh +28 -0
- package/hooks/post-agent-budget.sh +50 -0
- package/hooks/post-agent-return.sh +89 -3
- package/hooks/post-bash-failure.sh +39 -0
- package/hooks/post-bash-knowledge.sh +15 -34
- package/hooks/post-bash-verify.sh +33 -16
- package/hooks/post-build-check.sh +16 -18
- package/hooks/post-config-context.sh +13 -0
- package/hooks/post-delegation-nudge.sh +12 -1
- package/hooks/post-edit-track.sh +19 -28
- package/hooks/post-orch-decision.sh +35 -0
- package/hooks/post-read-config-context.sh +20 -0
- package/hooks/pre-account-guard.sh +1 -1
- package/hooks/pre-agent-spawn.mjs +2 -1
- package/hooks/pre-agent-spawn.sh +12 -1
- package/hooks/pre-bash-guard.sh +61 -3
- package/hooks/pre-bash-knowledge.sh +46 -0
- package/hooks/pre-credit-guard.sh +1 -1
- package/hooks/pre-edit-board.sh +44 -0
- package/hooks/pre-edit-check.sh +29 -5
- package/hooks/pre-edit-config-gate.sh +1 -1
- package/hooks/pre-edit-domain-gate.sh +23 -22
- package/hooks/pre-mark-complete.sh +32 -4
- package/hooks/pre-read-knowledge-inject.sh +34 -24
- package/hooks/pre-review-gate.sh +17 -0
- package/hooks/recorder-runner.sh +25 -2
- package/hooks/session-start-compact.sh +28 -0
- package/hooks/session-start.sh +167 -19
- package/hooks/skill-knowledge.sh +37 -0
- package/hooks/stop-claim-check.v3.sh +21 -3
- package/hooks/stop-usage-metrics.sh +138 -83
- package/hooks/subagent-stop-usage.sh +25 -0
- package/hooks/user-prompt-submit.sh +10 -4
- package/mcp-db-manager/dist/analyzers/duplicate-detector.js +1 -1
- package/mcp-db-manager/dist/core/model-parser.js +1 -1
- package/mcp-db-manager/dist/core/schema-reader.js +1 -1
- package/mcp-db-manager/dist/executors/migration-executor.js +1 -1
- package/mcp-db-manager/dist/generators/migration-generator.js +1 -1
- package/mcp-db-manager/dist/index.js +1 -1
- package/mcp-db-manager/dist/validators/schema-validator.js +1 -1
- package/mcp-dev-tester/dist/analyzers/auth-diagnoser.js +1 -1
- package/mcp-dev-tester/dist/analyzers/backend-analyzer.js +1 -1
- package/mcp-dev-tester/dist/analyzers/endpoint-diagnoser.js +1 -1
- package/mcp-dev-tester/dist/analyzers/frontend-analyzer.js +1 -1
- package/mcp-dev-tester/dist/analyzers/runtime-diagnoser.js +1 -1
- package/mcp-dev-tester/dist/analyzers/type-comparator.js +1 -1
- package/mcp-dev-tester/dist/analyzers/validation-diagnoser.js +1 -1
- package/mcp-dev-tester/dist/attestation.js +1 -1
- package/mcp-dev-tester/dist/browser/playwright-manager.js +1 -1
- package/mcp-dev-tester/dist/browser/ui-tester.js +1 -1
- package/mcp-dev-tester/dist/config/project-config.js +1 -1
- package/mcp-dev-tester/dist/index.js +1 -1
- package/mcp-dev-tester/dist/testers/api-tester.js +1 -1
- package/mcp-doc-fetcher/dist/index.js +1 -1
- package/mcp-html-renderer/dist/index.js +1 -1
- package/mcp-html-renderer/dist/preview.js +1 -1
- package/mcp-html-renderer/dist/template-engine.js +1 -1
- package/mcp-intelligence/dist/concept-catalog.js +1 -1
- package/mcp-intelligence/dist/concept-server-proxy.js +1 -1
- package/mcp-intelligence/dist/config-auth.js +1 -1
- package/mcp-intelligence/dist/contracts.generated.js +1 -1
- package/mcp-intelligence/dist/domain-templates.js +1 -1
- package/mcp-intelligence/dist/grounding.js +1 -1
- package/mcp-intelligence/dist/handlers.js +1 -1
- package/mcp-intelligence/dist/index.js +1 -1
- package/mcp-intelligence/dist/intelligence-file.js +1 -1
- package/mcp-intelligence/dist/knowledge-critic.js +1 -1
- package/mcp-intelligence/dist/knowledge-guide.js +1 -0
- package/mcp-intelligence/dist/knowledge-handlers.js +1 -1
- package/mcp-intelligence/dist/knowledge-migrate.js +1 -0
- package/mcp-intelligence/dist/knowledge-record.js +1 -0
- package/mcp-intelligence/dist/knowledge-scope.js +1 -0
- package/mcp-intelligence/dist/mention-extractor.js +1 -1
- package/mcp-intelligence/dist/provenance.js +1 -1
- package/mcp-intelligence/dist/sanitize.generated.js +242 -0
- package/mcp-intelligence/dist/semantic-embedder.js +1 -1
- package/mcp-log-watcher/dist/config-auth.js +1 -1
- package/mcp-log-watcher/dist/file-watcher.js +1 -1
- package/mcp-log-watcher/dist/index.js +1 -1
- package/mcp-log-watcher/dist/known-solutions.js +1 -1
- package/mcp-log-watcher/dist/log-store.js +1 -1
- package/mcp-log-watcher/dist/sanitize.generated.js +242 -0
- package/mcp-log-watcher/dist/websocket-server.js +1 -1
- package/mcp-log-watcher/package.json +1 -1
- package/mcp-plan-manager/dist/__tests__/file-ops-knowledge-dir.test.js +1 -1
- package/mcp-plan-manager/dist/__tests__/plan-parser.test.js +1 -1
- package/mcp-plan-manager/dist/file-ops.js +1 -1
- package/mcp-plan-manager/dist/index.js +1 -1
- package/mcp-plan-manager/dist/plan-parser.js +1 -1
- package/mcp-project-context/dist/git-ops.js +1 -1
- package/mcp-project-context/dist/index.js +1 -1
- package/mcp-project-context/dist/project-analysis.js +1 -1
- package/mcp-routinecode/dist/agent-tracker.js +1 -1
- package/mcp-routinecode/dist/analysis-ledger.js +590 -0
- package/mcp-routinecode/dist/attestation.js +1 -1
- package/mcp-routinecode/dist/blast-radius.js +1 -1
- package/mcp-routinecode/dist/board.js +1 -0
- package/mcp-routinecode/dist/build-id.js +1 -0
- package/mcp-routinecode/dist/changeset.js +1 -1
- package/mcp-routinecode/dist/config-auth.js +1 -1
- package/mcp-routinecode/dist/config-map/applied.js +1 -0
- package/mcp-routinecode/dist/config-map/arch-graph.js +1 -1
- package/mcp-routinecode/dist/config-map/architect-store.js +1132 -1
- package/mcp-routinecode/dist/config-map/assign.js +1 -1
- package/mcp-routinecode/dist/config-map/audit-cli.js +1 -1
- package/mcp-routinecode/dist/config-map/audit.js +1 -1
- package/mcp-routinecode/dist/config-map/blocks.js +1 -1
- package/mcp-routinecode/dist/config-map/briefing.js +541 -1
- package/mcp-routinecode/dist/config-map/certify.js +10 -5
- package/mcp-routinecode/dist/config-map/const-use.js +1 -1
- package/mcp-routinecode/dist/config-map/context.js +219 -0
- package/mcp-routinecode/dist/config-map/convention-candidates.js +1 -0
- package/mcp-routinecode/dist/config-map/decisions.js +1 -1
- package/mcp-routinecode/dist/config-map/decls.js +1 -1
- package/mcp-routinecode/dist/config-map/drift.js +1 -1
- package/mcp-routinecode/dist/config-map/dup-safety.js +1 -1
- package/mcp-routinecode/dist/config-map/extract.js +1 -1
- package/mcp-routinecode/dist/config-map/field-contract.js +1 -1
- package/mcp-routinecode/dist/config-map/gate.js +796 -1
- package/mcp-routinecode/dist/config-map/hash.js +1 -1
- package/mcp-routinecode/dist/config-map/ident-norm.js +1 -1
- package/mcp-routinecode/dist/config-map/index-store.js +1051 -1
- package/mcp-routinecode/dist/config-map/light-eval.js +253 -1
- package/mcp-routinecode/dist/config-map/link.js +1 -1
- package/mcp-routinecode/dist/config-map/linked-repos.js +1 -1
- package/mcp-routinecode/dist/config-map/lookup.js +1 -1
- package/mcp-routinecode/dist/config-map/louvain.js +1 -1
- package/mcp-routinecode/dist/config-map/maintenance-cli.js +1 -1
- package/mcp-routinecode/dist/config-map/names.js +1 -1
- package/mcp-routinecode/dist/config-map/post-bash-eval.js +105 -0
- package/mcp-routinecode/dist/config-map/proposals.js +1 -1
- package/mcp-routinecode/dist/config-map/ratchet.js +148 -0
- package/mcp-routinecode/dist/config-map/recheck.js +148 -1
- package/mcp-routinecode/dist/config-map/repo-id.js +1 -1
- package/mcp-routinecode/dist/config-map/route-security.js +1 -1
- package/mcp-routinecode/dist/config-map/rule-import.js +1 -1
- package/mcp-routinecode/dist/config-map/scc.js +1 -1
- package/mcp-routinecode/dist/config-map/shape-eval.js +1 -1
- package/mcp-routinecode/dist/config-map/shape.js +1 -1
- package/mcp-routinecode/dist/config-map/snapshot.js +1 -1
- package/mcp-routinecode/dist/config-map/sole-impl.js +1 -1
- package/mcp-routinecode/dist/config-map/stable-id.js +1 -1
- package/mcp-routinecode/dist/config-map/store.js +1 -1
- package/mcp-routinecode/dist/config-map/swagger-check.js +1 -1
- package/mcp-routinecode/dist/config-map/task-eval.js +369 -1
- package/mcp-routinecode/dist/config-map/templates.js +1 -1
- package/mcp-routinecode/dist/contracts.generated.js +1 -1
- package/mcp-routinecode/dist/coverage.js +1 -1
- package/mcp-routinecode/dist/edit-tracker.js +1 -0
- package/mcp-routinecode/dist/explorer-advisor.js +1 -1
- package/mcp-routinecode/dist/failure-tracker.js +1 -1
- package/mcp-routinecode/dist/file-lock-registry.js +1 -1
- package/mcp-routinecode/dist/file-risk-scorer.js +1 -1
- package/mcp-routinecode/dist/index.js +1 -1
- package/mcp-routinecode/dist/known-solutions.js +1 -1
- package/mcp-routinecode/dist/ledger-miner.js +1 -1
- package/mcp-routinecode/dist/normalize-sig.js +1 -0
- package/mcp-routinecode/dist/observed-draft.js +1 -1
- package/mcp-routinecode/dist/observed-escalation.js +1 -0
- package/mcp-routinecode/dist/pattern-matcher.js +1 -1
- package/mcp-routinecode/dist/route-match.js +1 -1
- package/mcp-routinecode/dist/routines.js +1 -1
- package/mcp-routinecode/dist/rule-engine.js +1 -1
- package/mcp-routinecode/dist/rule-promoter.js +1 -1
- package/mcp-routinecode/dist/sanitize.generated.js +242 -0
- package/mcp-routinecode/dist/session-registry.js +1 -0
- package/mcp-routinecode/dist/skill-pack/sync.js +629 -0
- package/mcp-routinecode/dist/skill-pack/validate.js +278 -0
- package/mcp-routinecode/dist/telemetry-analyzer.js +1 -1
- package/mcp-routinecode/dist/test-runner.js +1 -1
- package/mcp-routinecode/dist/verification.js +1 -1
- package/mcp-routinecode/dist/viral-loop.js +1 -1
- package/mcp-routinecode/package.json +1 -1
- package/package.json +3 -3
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/agents/analyzer.md.sealed +1 -1
- package/plugin/agents/architect.md.sealed +1 -1
- package/plugin/agents/crawler.md.sealed +1 -1
- package/plugin/agents/explorer.md.sealed +1 -1
- package/plugin/agents/implementor.md.sealed +1 -1
- package/plugin/agents/looker.md.sealed +1 -1
- package/plugin/agents/planner.md.sealed +1 -1
- package/plugin/agents/recorder.md.sealed +1 -1
- package/plugin/agents/reviewer.md.sealed +1 -1
- package/plugin/agents/verifier.md.sealed +1 -1
- package/plugin/commands/analyze.md.sealed +1 -1
- package/plugin/commands/plan.md.sealed +1 -1
- package/plugin/commands/rc.md.sealed +1 -1
- package/plugin/commands/receipt.md.sealed +1 -1
- package/plugin/commands/recharge.md.sealed +1 -1
- package/plugin/commands/routines.md.sealed +1 -1
- package/plugin/commands/share.md.sealed +1 -1
- package/plugin/routinecode-prompt.md.sealed +1 -1
|
@@ -1 +1,369 @@
|
|
|
1
|
-
const a43_0xfd1c46=a43_0x2d55;(function(_0x591c65,_0x415d3d){const _0x3299a6=a43_0x2d55,_0x582368=_0x591c65();while(!![]){try{const _0x4360d4=parseInt(_0x3299a6(0x25f,'1$pA'))/(0x153c+0x24c8+0x3a03*-0x1)+parseInt(_0x3299a6(0x249,'2nVN'))/(0x229b*-0x1+-0x2611+0x48ae*0x1)*(parseInt(_0x3299a6(0x2e3,'mW9I'))/(-0x3*0x32d+-0x5ec*-0x6+-0xcff*0x2))+-parseInt(_0x3299a6(0x261,'1ROf'))/(-0xfaf+0x8*-0x1e+0x1*0x10a3)+-parseInt(_0x3299a6(0x314,'3@Z2'))/(0x25cf+-0x101*0xc+-0x19be*0x1)*(-parseInt(_0x3299a6(0x279,'aZ9^'))/(0x974+-0x1d5f+0x13f1))+-parseInt(_0x3299a6(0x301,'tZmL'))/(-0xef7+0x89*0x1b+-0x1*-0x8b)*(parseInt(_0x3299a6(0x2b9,'3u[J'))/(-0xce*-0x25+-0x4d+0x1d71*-0x1))+-parseInt(_0x3299a6(0x1da,'s6ZW'))/(-0x1*-0x76a+-0x2535*-0x1+-0x2c96)+-parseInt(_0x3299a6(0x1bb,'H)Mz'))/(-0x21e2+0x1b7*0xc+0xd58);if(_0x4360d4===_0x415d3d)break;else _0x582368['push'](_0x582368['shift']());}catch(_0x5546d0){_0x582368['push'](_0x582368['shift']());}}}(a43_0x2154,0x114839+0x1*-0xa53aa+0x90e*0x81));import*as a43_0x495bd3 from'fs';import*as a43_0x147f98 from'path';import{spawnSync}from'child_process';function a43_0x2154(){const _0x2ad7ac=['z3OSWRRdTgNdGCoJW5qFW7X7','W4zowcFcHCo/aw8','W7FcMCkg','WP95fCk3tKdcVCkaWQhdGvW','jCoXlcL/','WR7dPf7cICkJW6Lbuq','s8oOWObKd8kJeSkurwldNGOZ','DLVdRW','hXBdOSkWW5RcMG','W49awM8','D2eJWR3dTwG','W4lcGmoxEZFdIq','FmktWOhdMs3dK2NdPW','gr7dVmka','W7iobCkH','WQOazSo2ra','zdi2WQy','fCoKWQD6W7xdNcC','W7/dQmoG','BL8ec8oq','W6xdMCozW604','W5ClxhJcVWZcVqPKW5mNcG','t8oMWPa','W67cL8kgmr/dOCooW4m','W5HDrvrj','f8khnMO','CSkvWOVdHq','B3a7WRO','WQ84WPFcSgm','mXFdUmomWQBcKwtcGfHEyLBcPdbT','W5hcH8oqyt3dJmkx','imoTW4ldSW','DaZdPa','p8k1W7pcOvBdIL7dV1XuWOvUxq','F8oSWRhdPaRcGa','eSoVWQb/W6BdMIy','W4rgiSkn','W5hcH8omzIddNSkD','CIeSWQ5FWQJcJ8oW','WPPQW6C3WOS','Du4B','iZ8Lma','WRqoCmoNCdVdQgDx','W6FdNSoaW6yZFmkgzdFcN1nWzW','yNWUWR3dPwK','W5vCFCkhvSkA','qmo2CG','WPmxgSo8','W7ZdKCogW60','W7FdPmoQ','W4rCy8kl','EmkvWONdHq','Euyoba','F8o6W7a','ESo/W6SikG','asNdOMm','WOddSSo3i1G','W77dGZFdL1yREmoUW7rk','WPBdSSo4lL/cP8k4ba','yI8ZWQ4','fmoUWQvI','W5bjth0jW7L3','W67dMdJdLLyQtSoUW65woq','W5Tnqq','W5KOuSoRhG','W4mCuNe','W7JdQmo3manG','f8oYEColzSkOq8oDpSk3','amkgp3e8w8k9at3cRafWWRCYWQjKWR0zwa','WPRdP3xcNW','WRq0WPpcSgS','WPddSSoNoW','W4nrAW','W4PqBSkksW','W77dLwpcPmkKW5PC','ySkWWRdcS8kaW6m7ia','DCkRBG','W4vziCkqpq','CSkRWRdcSG','isu5ldqvmHGs','uSo5AW','yMCTWQq','WQVdRIi','ymoIWRFdUWRcLW','W6OedG','WQ7dTfVcHmkZW7m','qSoJAX48umkgDa','W4vfjmkAla','as3dUevctW','A8o2W7a','W4SlsKpcMGW','W4/cJmoc','W5SSW78aW5lcT2bXk8kQy0GbFuWbECob','u8kYW6aKWQBcJNlcQGtcHHrwW5C','aHBdPSkm','Bv/dRa','W5RcNSk1hmoQwCkrdsxcQCovWP5I','A8ksWO7dJGRdHxq','bmk6lenGh8ovyCk9WPn5WR/cLW','W79EWRtdTa','BhqX','W4LowZe','W4Klu3VcJq0','W7NdMCofW6W','fCkDkNy','pY84pWyu','W6JcL8kzkq','bSoLymouD8kTDCoi','W4HgrsC','vmoJASocia','mcmL','WOqDa8o4W4xdTa','uSoPWPrSeCkJnq','W77dKIi','bG7dOSkb','WQu0WO3cSa','W5SSW78aW5lcT2bXk8kQBeu','W5FcHSojEW','vmoNySoojSkU','umoLDWy8va','w8oTAW','pYm4pq','q0/cP8oDWOhcVSkQfSkcW5fG','W77dOSoWoq','bCo0WR56W7ddJa','W44hu3G','lmoIW7q','EmoGcwm','DmkRAGdcUHa3','WO1ZW74','D2uUWQddTa','W6ZcMCkAkb/dPa','Csq7','WO3dPNZcHbmfW7e','WQddPfZcJ8kJW6G','fSkvW5tdJW','WPanbmoX','W4OOuSoGg3NcVq','aqpdVCkwW5dcRSkMjG','W7pdNmocW6KVw8kAvJJcHej7CW','f2JcJCo2','WRa4WPlcPMBcLmomqGJdOa','WRhdPtf1WQTYfZW','A8oNW6uznuWoz1GY','WR/dUf/cISk4W6W','W6BdOSo2iW','FmoSna','W5bnw38pW54','W6TyWQ3dV8kx','W5baiCknld4','DXZdOa','B8oMmgVcSaJcH8kp','WRtdOJX8W6q','W4aGtCoR','W7JcJCkFmr7dPa','WQu4fSo6W4iSFSoKnrtdUqxcHNbRt8oIiva','DNaYWQxdOxJdHq','WPqxb8o1W4NdRKuz','vCoJDqeTvmkcCCkYWP9gWO8','W4aaw3pcIWBcTaT0W4uNgSomBudcSeK7cq','WOvVW6aX','q8oYWPm','cxxcHCk/uG','ECk4WQ8','ymoIWRq','W6qpeCk6qbjP','cw/cImo8bCk4za','ASo8W6SF','WPZdP2RcHWqqW7f3','WQGYd8oFW4i4','dCkaW5/cH8o5','AmoSna','kCoLlW','W7ZcKCkAoa','W60VWO7cOhVcKSomEaldQ8o1W6O','fmo1WRHKW7hdUYVcOq','W7pdLmop','E0yebW','FSo3WQxdPbRcGa','z8kPWRpcTSkv','WO3dHCoGt8kR','W4fap8kClq','W7PyWRBdOSkhW4pcQmoAt8kPW6RdJrFcQJqHCva','rCoPAaeWsCknr8k1WO8','W6afeW','zSkLW5/dT8k1W4y/FW','n8o8i1JdRKbKxZHBW78KCq','pmkXW73cPL3dGf3dOMHJWOnUCW','ymkNDGK','WQS4hmo5W4C','aCkDkq','W7/dMdNdKwqXq8oIW7m','W5bhvNKxW5nsWRBdIX3cTKyf','nsm6pqe','cgZcQ1vtWQ3cRG','WPNdMCoI','WR/dRIy','W7jtkCkHdMFdRLbkgcZdLG','WRJdOehcG8o6W6Hsvw10W5DJWPzHmW','yqBdV8k3','oSo4W6VcLW','z8kICW3cQcmGvHXfW48xAa','WQO4g8o9W4CUySo/orFdSYJcKa','Ce4y','e8kbnNiVtmkXcHdcSa','jmo+W6RcHG','WPTPW6eG','W7tdMCohW7W5Eq','W7TBWRFdSSky','W6hdHmokW7WPEa','FSoSWRBdPa','W7qpamk8qbrO','y3a2','umoLDXCQ','hbBdV8kb','W7dcL8kFmW','W4bksc7cMG','WOWxfmo4W4ddVwmAW5LJWR7cG8o/','fb7dVSkb','F8oSWQVdPa','W4DgyIy','fgdcKa','cSoKWQrLW7xdMcC','faxdVCkj','arldPG','cCoKWQbvW73dJa','s8oIWO1If8kU','W5Clux3cJqZcPWO','z3HGAKPjnc8peWtdKa','WPixaSoTW4xdTKuwW5T3WRRdNmoPW5u/k1NcRXWDW4/dHJldRSkWWOqQvvrvaa','DgaXWQe','W6tdMCoeW6q9F8knvW','DCk6FGpcRGC','W6yeaW','v8oOFW','W4GOtmo6h2y','C8k8WQS','Amo9ixpcOa0','AxqYWRO','qCo6ASoo','DCkvWOVdHa','W4Gluh7cNbFcOG','gSoRyW','FqJdVCkM','W6TmCCo8gYddOwXfiZ3dQW','WQCZha','eCoOWRH6W7xdIYVcVdNcUW','W6ddN8oEW6y4','mCoXlW0','WRqeE8oMvtC','WOLXWQHhWPpdTJD0b8kPBxCf','yZqTWQjDWQy','WO0xe8o8W4a','ewdcMW','DmkHDrG','WRu4cSoO','lSo+W6JcL1FdNG','A8o8m28','p8kYWQNdStBcOIpdKq','sSoIWPDTdmkI','W6PyWQRdPq','cCkbn3S','W54QW70wW5u','WQ/dRL/cMmk4W65swN0','W5baiCkC','CmoYW7C','W7NdRmoP','W4vmoq','W6FdNSoaW6yZFmkg','W6TyWRFdPq','W5mQW78x','W77cUahdNCoUWRqdyhnqWPXGWQe','cwdcQfi','cwBcPvzAWRRcNSojWQScWPJdPMq','WPmDaCo8W57dSvqm','W7/dKCoFW6S0sSkexW','dcddQMva','WO0rdcG1W6bMWQZdPWm','aCoOWRTIW7hdJq','h8oRya','yYKLWQ4','ySk4WRpcQSkeW6q','WQeeAW','e8kDW5FdJG','W54QW70w','hc3dUW','f8khnxS9','WPqDbmoT','W7vyWRVdSmkFW5tcISoCtmkTW43dLHW','W7/cLSkqmGJdTmoo','W7/dKIBdIum7sG','W6NcJmksmG/dOW','W63cKCkeob4','e8oUDa','A8oNW6SzjhSWFa','WRBdQJ98','a2dcQLjf','gw/cHCo9gmkSBW','WO9VW6iX','eCoLFCoiFCk1DCokja','WRu+aSo5','WRBdRIvAWRDL','AmoMW7Cd','DqddVmkMCW','W55ipG','WR/cNCofW6KXBSofxddcGum','WQq2c8o5W4CIt8o1','W6NdNItdI0m1sG','WRVdOIe','FCoRW7a','n8oTmWKVW6VdQYhdMSoj','A8o8W7yF','EfpdSmorWQxcHq','W5bAymkA','kGNcQ8kxW7ldHNNcN2j8rLhcRW','WQa+fmoOW445','AhOHWQJdRh7dO8oLW5CBW5rTBq','a2dcQLi','FSo6WQNdSGdcNW','W7tcNCkbaHNdVG','eh3cObOo','W67dLJJdIKWXtmoMW6W','W6ddN8oeW7W','WPyrgmo1W43dReKAW5PG','yaBdOSk3','WOnPW6C6','WOldVSo4o07cVa','eCoLFCoiFSk+zmob','WPPPW7WG','W58MW6u','f8oKDmo0E8k1Dq','WPFdUmoMoW','d23cISoXdW','DmktWOZdJG','FWZdVSkKDmkE','WRuJcSo1W4uS','FGZdVCkHzCkeW6m','nSo7W5BdR8kKW7yhqa','WRaPWOdcOxRcIa','lCoHmGi6W7C','AmkRBs/cSGa','hw3cISoZgCkFEa0lW4uOWR8D','DYuR','Cuala8oirmoldSkQW4JdQN7cQq','yCoIWR3dTr3cVa4','qmkZi8knk8oVjmoWkSkdo14W','rSo3yG','DIKZWQ5a','hsFdUNjo','W4jBjmku','cwZcQfbcWRC','W7pdPmoT','W67dMdVdLu49w8oI','BCo9W7mcm1O9','WRtdOJX8','W5yltq','vmoIWPC','W6FdNSoCW6eUBSkm','dCoUWR54','nCo2nqG','W45hwMW','ymkNDHJcVGe','WQmzAW','f8o0WQr+','aCoOWRTZ','W7NdKIxdKq','W7vsWRBdTSkhW5K','WO3dNSoJrW','Cmk9zvuaW4NdTtVdTCou','qmoIWPC','WO8khSo+W4xdTG','DNOTWR0','FcKXWQ4','cCknn3K6ua','vCo8ACoF','dMdcQfm','W4GOtmoRcq','CL/dSSocWRtcNW','W5FcMCoxzIy','AhWSWQW','cSkrW5JdMCkUrG','bmoysJ4QFmki'];a43_0x2154=function(){return _0x2ad7ac;};return a43_0x2154();}import{GIT_SAFE}from'../changeset.js';import{buildWorkspace}from'./store.js';import{computeAudit}from'./audit.js';import{extractDecls}from'./decls.js';import{maskSource,shortHash}from'./hash.js';function a43_0x2d55(_0x4a18a6,_0xe2f0c2){_0x4a18a6=_0x4a18a6-(-0x2254+0x2088+0x36e);const _0x350503=a43_0x2154();let _0x327f87=_0x350503[_0x4a18a6];if(a43_0x2d55['QOcysc']===undefined){var _0x12db0e=function(_0x9c5de){const _0x1266b9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x346b26='',_0x328965='';for(let _0x1b3be4=-0x35+0x9*-0x365+0xfe*0x1f,_0x1492e5,_0x504e64,_0x31e824=0x1*0xe0a+0x3c2+-0x11cc;_0x504e64=_0x9c5de['charAt'](_0x31e824++);~_0x504e64&&(_0x1492e5=_0x1b3be4%(-0x1ed9+0x1b52+-0x38b*-0x1)?_0x1492e5*(-0x136f+-0x964*-0x1+-0xa4b*-0x1)+_0x504e64:_0x504e64,_0x1b3be4++%(0xd3d+-0x123a*-0x2+-0x31ad))?_0x346b26+=String['fromCharCode'](-0x179b+-0x11a7*-0x1+0x6f3&_0x1492e5>>(-(-0xdfd+-0x14cc+0x22cb)*_0x1b3be4&0xd*-0x218+0x7*-0x335+-0x31b1*-0x1)):0x59*-0x1+-0x1a17+0x1a70){_0x504e64=_0x1266b9['indexOf'](_0x504e64);}for(let _0x185723=0x2*-0xf4f+0x23d0+0x10a*-0x5,_0x5ae8b4=_0x346b26['length'];_0x185723<_0x5ae8b4;_0x185723++){_0x328965+='%'+('00'+_0x346b26['charCodeAt'](_0x185723)['toString'](0x927+-0x1080+-0x7*-0x10f))['slice'](-(-0x245e+0x17b4+0x1*0xcac));}return decodeURIComponent(_0x328965);};const _0x4e0451=function(_0x32896e,_0x8be69e){let _0x2e1044=[],_0x2fa689=0x1*0x1606+-0xab8+0x2*-0x5a7,_0x23efeb,_0x3a56c8='';_0x32896e=_0x12db0e(_0x32896e);let _0x2bb334;for(_0x2bb334=-0x21c3*0x1+-0x21d*0x6+0x2e71;_0x2bb334<0x24d3+0x225d+-0x4630;_0x2bb334++){_0x2e1044[_0x2bb334]=_0x2bb334;}for(_0x2bb334=0x1*-0x158b+-0x22b5*0x1+0x3840;_0x2bb334<0x1*0x259+0x12df+-0x1438;_0x2bb334++){_0x2fa689=(_0x2fa689+_0x2e1044[_0x2bb334]+_0x8be69e['charCodeAt'](_0x2bb334%_0x8be69e['length']))%(0x13c4+-0x201e*0x1+0xd5a),_0x23efeb=_0x2e1044[_0x2bb334],_0x2e1044[_0x2bb334]=_0x2e1044[_0x2fa689],_0x2e1044[_0x2fa689]=_0x23efeb;}_0x2bb334=0x1cf0+-0x799+-0x1557,_0x2fa689=-0x57*-0x1e+-0xd*-0xcc+-0x2*0xa47;for(let _0x1acfba=0xcf7*-0x3+0x1*-0x407+0x2aec;_0x1acfba<_0x32896e['length'];_0x1acfba++){_0x2bb334=(_0x2bb334+(-0x130d*-0x1+0x1966+-0x1639*0x2))%(0xbe*0x13+-0x21e2+0x14c8),_0x2fa689=(_0x2fa689+_0x2e1044[_0x2bb334])%(0x255e+-0x1e57*-0x1+-0x1*0x42b5),_0x23efeb=_0x2e1044[_0x2bb334],_0x2e1044[_0x2bb334]=_0x2e1044[_0x2fa689],_0x2e1044[_0x2fa689]=_0x23efeb,_0x3a56c8+=String['fromCharCode'](_0x32896e['charCodeAt'](_0x1acfba)^_0x2e1044[(_0x2e1044[_0x2bb334]+_0x2e1044[_0x2fa689])%(0x2*-0x411+-0x1a*-0x2a+-0x59*-0xe)]);}return _0x3a56c8;};a43_0x2d55['nXfaDX']=_0x4e0451,a43_0x2d55['OqgopR']={},a43_0x2d55['QOcysc']=!![];}const _0x14f255=_0x350503[-0x18+-0x7*-0x3c7+-0x1a59],_0x141596=_0x4a18a6+_0x14f255,_0x378f49=a43_0x2d55['OqgopR'][_0x141596];return!_0x378f49?(a43_0x2d55['oBrtUd']===undefined&&(a43_0x2d55['oBrtUd']=!![]),_0x327f87=a43_0x2d55['nXfaDX'](_0x327f87,_0xe2f0c2),a43_0x2d55['OqgopR'][_0x141596]=_0x327f87):_0x327f87=_0x378f49,_0x327f87;}import{dropLegacy,effective}from'./shape-eval.js';import{fileFindings,GATE_TYPES}from'./light-eval.js';import{DEFAULT_ROLES}from'./shape.js';import{locateMap,readTracker,realpathLoose,knowledgeDir,readJson,typeFlagOn as a43_0x560394,emitTypedEvent,runnerSessionId,homeDir}from'./index-store.js';export function trackerHeads(){const _0x43f1bf=a43_0x2d55,_0x2c6096=readTracker(),_0x4651ef=readJson(a43_0x147f98[_0x43f1bf(0x27a,'H^!6')](knowledgeDir(),_0x43f1bf(0x2c5,'2nVN')))??{};return _0x755b6a=>_0x2c6096[_0x43f1bf(0x248,'0aB]')][_0x755b6a]??(typeof _0x4651ef[_0x755b6a]===_0x43f1bf(0x2fa,'rpRw')?_0x4651ef[_0x755b6a]:null);}export function fileAtHead(_0x320e73,_0x211d28,_0x361081){const _0x1a7c88=a43_0x2d55,_0x4d5832=a43_0x147f98[_0x1a7c88(0x204,'2nVN')](_0x320e73,_0x361081)[_0x1a7c88(0x281,'Xc[7')](a43_0x147f98[_0x1a7c88(0x251,'8YC^')])[_0x1a7c88(0x1e7,'piHA')]('/');if(_0x4d5832[_0x1a7c88(0x28e,'#7C2')]('..'))return null;const _0x3fb344=spawnSync(_0x1a7c88(0x1e0,'H^!6'),[_0x1a7c88(0x208,'3@Z2'),_0x211d28+':'+_0x4d5832],{'cwd':_0x320e73,'encoding':_0x1a7c88(0x1c1,'638^'),'maxBuffer':(0x2*0x5c3+0x1*0x19dc+-0x2542)*(-0x7*0x1a2+-0x1ed9+-0x2e47*-0x1)*(-0x136f+-0x964*-0x1+-0xe0b*-0x1),'timeout':0x3a98});if(_0x3fb344[_0x1a7c88(0x2ec,'Uqxr')]===0xd3d+-0x123a*-0x2+-0x31b1)return _0x3fb344[_0x1a7c88(0x2e7,'3u[J')];const _0x5a73da=String(_0x3fb344[_0x1a7c88(0x275,'xG^p')]??'');if(/exists on disk, but not in|does not exist in|path '.*' does not exist/i[_0x1a7c88(0x1ee,'@A9S')](_0x5a73da))return'';return null;}const SRC_EXT_RE=/\.(tsx?|jsx?|mjs|cjs|mts|cts)$/;export function deletedSinceHead(_0x13dafd,_0x5a9a0e,_0x3c7ef4){const _0x53169c=a43_0x2d55,_0x51ce90=a43_0x147f98[_0x53169c(0x239,'*re9')](_0x13dafd,_0x3c7ef4)[_0x53169c(0x26c,'xG^p')](a43_0x147f98[_0x53169c(0x25e,'H)Mz')])[_0x53169c(0x27a,'H^!6')]('/');if(_0x51ce90[_0x53169c(0x238,'@A9S')]('..'))return[];const _0x42fef2=spawnSync(_0x53169c(0x234,'#7C2'),[...GIT_SAFE,'-C',_0x13dafd,_0x53169c(0x233,'[)o0'),_0x53169c(0x1b2,'uW9s'),_0x53169c(0x2f3,'gfid'),_0x53169c(0x21c,'H)Mz'),'-z',_0x5a9a0e,'--',_0x51ce90||'.'],{'encoding':_0x53169c(0x2a9,'$pZi'),'maxBuffer':(-0x179b+-0x11a7*-0x1+0x604)*(-0xdfd+-0x14cc+0x26c9)*(0xd*-0x218+0x7*-0x335+-0x4e1*-0xb),'timeout':0x3a98});if(_0x42fef2[_0x53169c(0x1d3,'j[OY')]!==0x59*-0x1+-0x1a17+0x1a70)return[];return String(_0x42fef2[_0x53169c(0x1a4,'Cjpo')]??'')[_0x53169c(0x2b2,'5wu%')]('\x00')[_0x53169c(0x294,'9z%H')](_0x58f2d7=>_0x58f2d7&&SRC_EXT_RE[_0x53169c(0x246,'*re9')](_0x58f2d7))[_0x53169c(0x277,'1ROf')](_0x4863ba=>a43_0x147f98[_0x53169c(0x1e7,'piHA')](_0x13dafd,_0x4863ba))[_0x53169c(0x1c5,'C[92')]();}function existingAncestor(_0x5e21db){const _0x3d2e10=a43_0x2d55;let _0x304a84=a43_0x147f98[_0x3d2e10(0x1b4,'@A9S')](_0x5e21db);for(let _0x275cbf=0x2*-0xf4f+0x23d0+0x10a*-0x5;_0x275cbf<0x927+-0x1080+-0x5*-0x185&&!a43_0x495bd3[_0x3d2e10(0x242,'s6ZW')](_0x304a84);_0x275cbf++){const _0x1e0845=a43_0x147f98[_0x3d2e10(0x288,'rnUo')](_0x304a84);if(_0x1e0845===_0x304a84)break;_0x304a84=_0x1e0845;}return _0x304a84;}export function evaluateTaskFiles(_0x3bbd71,_0x4eb7e0=trackerHeads()){const _0x11c1fa=a43_0x2d55,_0x28438a=new Map();for(const _0x1e7c08 of Array[_0x11c1fa(0x250,'Xc[7')](new Set(_0x3bbd71))[_0x11c1fa(0x274,'4q]a')]()){if(!SRC_EXT_RE[_0x11c1fa(0x31e,'pvK@')](_0x1e7c08))continue;const _0x46899e=realpathLoose(_0x1e7c08),_0x5039cb=locateMap(_0x46899e);if(!_0x5039cb)continue;if(_0x5039cb[_0x11c1fa(0x29c,'pvK@')]!==_0x5039cb[_0x11c1fa(0x207,'aZ9^')])continue;const _0x70990=_0x28438a[_0x11c1fa(0x2eb,'5wu%')](_0x5039cb[_0x11c1fa(0x289,'aZ9^')])??{'root':_0x5039cb[_0x11c1fa(0x244,'NF4N')],'toplevel':_0x5039cb[_0x11c1fa(0x216,'Cjpo')],'files':[]};_0x70990[_0x11c1fa(0x2c0,'mW9I')][_0x11c1fa(0x228,'mW9I')](_0x46899e),_0x28438a[_0x11c1fa(0x24b,'3u[J')](_0x5039cb[_0x11c1fa(0x1a7,'#7C2')],_0x70990);}if(!_0x28438a[_0x11c1fa(0x317,'rpRw')])return null;for(const [_0x134d7c,_0x1e63e6]of _0x28438a){const _0x15a5a4=_0x4eb7e0(_0x1e63e6[_0x11c1fa(0x2a7,'NF4N')],_0x1e63e6[_0x11c1fa(0x290,'H^!6')]);if(!_0x15a5a4)continue;for(const _0x230571 of deletedSinceHead(_0x1e63e6[_0x11c1fa(0x296,'Uqxr')],_0x15a5a4,_0x1e63e6[_0x11c1fa(0x290,'H^!6')])){if(_0x1e63e6[_0x11c1fa(0x1dc,'rpRw')][_0x11c1fa(0x28d,'8YC^')](_0x230571))continue;const _0x39dbe4=locateMap(existingAncestor(_0x230571));if(_0x39dbe4&&_0x39dbe4[_0x11c1fa(0x2ae,'piHA')]===_0x134d7c)_0x1e63e6[_0x11c1fa(0x1a9,'638^')][_0x11c1fa(0x2f7,'6dx4')](_0x230571);}_0x1e63e6[_0x11c1fa(0x1f9,'rnUo')][_0x11c1fa(0x23b,'piHA')]();}const _0x45ac61={'maps':[],'files':0x0,'rootFiles':{},'newCis':[],'wired':[],'unwired':[],'unknownWiring':0x0,'dup':[],'violations':[],'enforcedConstraints':0x0};for(const _0x5d25cc of Array[_0x11c1fa(0x240,'Dwpf')](_0x28438a[_0x11c1fa(0x282,'Cjpo')]())[_0x11c1fa(0x2fe,'mNd2')]((_0x1bf7dc,_0x1eae8a)=>_0x1bf7dc[_0x11c1fa(0x1f7,'xG^p')][_0x11c1fa(0x1bd,'Xc[7')](_0x1eae8a[_0x11c1fa(0x1f4,'Xc[7')]))){const _0x3feeaa=buildWorkspace(_0x5d25cc[_0x11c1fa(0x30c,'BPqs')]),_0x26ef83=computeAudit(_0x3feeaa),_0x569890=_0x3feeaa[_0x11c1fa(0x2f0,'Dwpf')][-0x245e+0x17b4+0x1*0xcaa];if(!_0x569890)continue;_0x45ac61[_0x11c1fa(0x264,'dOl0')][_0x11c1fa(0x1ec,'piHA')](_0x5d25cc[_0x11c1fa(0x2c6,'C[92')]);const _0x357e7c=new Set(),_0x242cba=new Set(),_0x331194=new Map(),_0x183737=new Map(),_0x49bdf9=_0x3feeaa[_0x11c1fa(0x1b3,'mNd2')][_0x11c1fa(0x23d,'@A9S')]??[];_0x45ac61[_0x11c1fa(0x29e,'Dwpf')]+=_0x49bdf9[_0x11c1fa(0x276,'1ROf')](_0x98b7aa=>{const _0x79e0d4=_0x11c1fa,_0x425a9d=effective(_0x98b7aa)[_0x79e0d4(0x2a4,'e6Rk')];return _0x425a9d===_0x79e0d4(0x1c8,'s6ZW')||_0x425a9d===_0x79e0d4(0x2cf,'BPqs');})[_0x11c1fa(0x1d4,'6dx4')];const _0x5ccd00={...DEFAULT_ROLES,..._0x3feeaa[_0x11c1fa(0x225,'rpRw')][_0x11c1fa(0x31d,'zVX2')]??{}},_0x289b8f=_0x2c6cff=>(_0x3feeaa[_0x11c1fa(0x200,'dOl0')][_0x11c1fa(0x1c2,'@A9S')]??[])[_0x11c1fa(0x2ce,'uW9s')](_0x398663=>_0x398663[_0x11c1fa(0x23a,'rpRw')]===_0x2c6cff&&_0x398663['ci'])[_0x11c1fa(0x2ca,'[)o0')](_0x2e6f9e=>_0x2e6f9e['ci']),_0x473620=new Set(),_0x1ab680=new Map();for(const _0x4a3bad of _0x5d25cc[_0x11c1fa(0x1b0,'C[92')]){const _0x2a4bd9=a43_0x147f98[_0x11c1fa(0x2e2,'Dwpf')](_0x5d25cc[_0x11c1fa(0x2da,'tZmL')],_0x4a3bad)[_0x11c1fa(0x24c,'9z%H')](a43_0x147f98[_0x11c1fa(0x1e4,'Dwpf')])[_0x11c1fa(0x1ce,'RxDv')]('/'),_0x30d737=_0x4eb7e0(_0x5d25cc[_0x11c1fa(0x26a,'s6ZW')],_0x4a3bad),_0x3e37b3=_0x30d737?fileAtHead(_0x5d25cc[_0x11c1fa(0x255,'1ROf')],_0x30d737,_0x4a3bad):null;if(_0x3e37b3===null)continue;_0x242cba[_0x11c1fa(0x1db,'xG^p')](_0x2a4bd9),_0x45ac61[_0x11c1fa(0x305,'uxVB')]++,_0x45ac61[_0x11c1fa(0x2be,'@A9S')][_0x5d25cc[_0x11c1fa(0x2fd,'3u[J')]]=(_0x45ac61[_0x11c1fa(0x229,'gfid')][_0x5d25cc[_0x11c1fa(0x2fd,'3u[J')]]??0x1*0x1606+-0xab8+0x2*-0x5a7)+(-0x21c3*0x1+-0x21d*0x6+0x2e72);const _0x4cf289=extractDecls(_0x3e37b3,{'aliasPrefixes':_0x3feeaa[_0x11c1fa(0x299,'Cjpo')][0x24d3+0x225d+-0x4730]?.[_0x11c1fa(0x2c8,'3u[J')]});if(_0x49bdf9[_0x11c1fa(0x1ef,'BPqs')]){const _0x55ea24=()=>_0x569890[_0x11c1fa(0x26d,'mW9I')][_0x11c1fa(0x1b9,'H)Mz')](_0x587a37=>_0x587a37[_0x11c1fa(0x307,'9z%H')]!==_0x2a4bd9&&(_0x587a37[_0x11c1fa(0x1eb,'gfid')]?.[_0x11c1fa(0x265,'Dwpf')]??0x1*-0x158b+-0x22b5*0x1+0x3840)>0x1*0x259+0x12df+-0x1538&&(_0x587a37[_0x11c1fa(0x1f8,'638^')]===_0x11c1fa(0x28f,'2nVN')||_0x587a37[_0x11c1fa(0x31a,'$pZi')]===_0x11c1fa(0x306,'2nVN')||_0x587a37[_0x11c1fa(0x28b,'Z!2N')]===_0x11c1fa(0x2bc,'mNd2')))[_0x11c1fa(0x2a2,'5wu%')](_0x30ea86=>({'id':_0x30ea86['id'],'kind':_0x30ea86[_0x11c1fa(0x2ef,'RxDv')],'file':_0x30ea86[_0x11c1fa(0x272,'j[OY')],'name':_0x30ea86[_0x11c1fa(0x2f2,'C[92')],'line':_0x30ea86[_0x11c1fa(0x304,'zVX2')],'endLine':_0x30ea86[_0x11c1fa(0x1cb,'s6ZW')],'layer':_0x30ea86[_0x11c1fa(0x20e,'gfid')],'bodyHash':_0x30ea86[_0x11c1fa(0x20b,'RxDv')],'ext':_0x30ea86[_0x11c1fa(0x1b6,'#7C2')]})),_0x3f3c55={'root':_0x5d25cc[_0x11c1fa(0x223,'9z%H')],'rel':_0x2a4bd9,'layer':_0x569890[_0x11c1fa(0x1d9,'tZmL')](_0x2a4bd9),'layerOf':_0xc5ad99=>_0x569890[_0x11c1fa(0x23c,'3@Z2')](_0xc5ad99),'aliasPrefixes':_0x3feeaa[_0x11c1fa(0x254,'2nVN')][0x13c4+-0x201e*0x1+0xc5a]?.[_0x11c1fa(0x28a,'uW9s')]};try{_0x331194[_0x11c1fa(0x1e5,'IDj&')](_0x2a4bd9,fileFindings(_0x49bdf9,{'ctx':_0x3f3c55,'text':_0x3e37b3,'decls':_0x4cf289,'roles':_0x5ccd00,'holders':_0x55ea24,'canonical':_0x289b8f}));}catch{}try{const _0x40520e=a43_0x495bd3[_0x11c1fa(0x214,'Dwpf')](_0x4a3bad,_0x11c1fa(0x2a1,'Z!2N'));_0x183737[_0x11c1fa(0x30a,'9z%H')](_0x2a4bd9,fileFindings(_0x49bdf9,{'ctx':_0x3f3c55,'text':_0x40520e,'decls':extractDecls(_0x40520e,{'aliasPrefixes':_0x3feeaa[_0x11c1fa(0x27b,'piHA')][0x1cf0+-0x799+-0x1557]?.[_0x11c1fa(0x1d6,'Z!2N')]}),'roles':_0x5ccd00,'holders':_0x55ea24,'canonical':_0x289b8f}));}catch{}}const _0x24515f=new Set(_0x4cf289[_0x11c1fa(0x2d7,'dOl0')][_0x11c1fa(0x309,'H^!6')](_0x2b467a=>_0x2b467a[_0x11c1fa(0x1a8,'8YC^')]));_0x1ab680[_0x11c1fa(0x270,'@A9S')](_0x2a4bd9,_0x24515f);const _0x4b6348=new Set(_0x4cf289[_0x11c1fa(0x221,'tZmL')][_0x11c1fa(0x309,'H^!6')](_0xc9e3d8=>_0xc9e3d8[_0x11c1fa(0x302,'IDj&')]+'\x20'+_0xc9e3d8[_0x11c1fa(0x25d,'aZ9^')]));for(const _0x130b65 of _0x4cf289[_0x11c1fa(0x237,'*re9')])_0x357e7c[_0x11c1fa(0x1a6,'s6ZW')](_0x130b65[_0x11c1fa(0x1d2,'dyrQ')]);for(const _0x13a7ce of maskSource(_0x3e37b3)[_0x11c1fa(0x252,'tZmL')][_0x11c1fa(0x1fb,'4q]a')]('\x0a'))_0x357e7c[_0x11c1fa(0x247,'0aB]')](_0x11c1fa(0x297,'8YC^')+shortHash(_0x13a7ce[_0x11c1fa(0x210,'piHA')](/\s+/g,'\x20')[_0x11c1fa(0x1de,'9z%H')]()));for(const _0x45d23b of _0x3e37b3[_0x11c1fa(0x312,'uW9s')](/^\s*import\b[^;'"]*?(?:from\s*)?['"][^'"]+['"]\s*;?/gm)){const _0x162a99=_0x45d23b[-0x57*-0x1e+-0xd*-0xcc+-0x2*0xa47][_0x11c1fa(0x1e8,'6dx4')]()[_0x11c1fa(0x27f,'3u[J')](/\s+/g,'\x20');_0x357e7c[_0x11c1fa(0x2f4,'mNd2')](shortHash(_0x162a99)),_0x357e7c[_0x11c1fa(0x2e9,'1ROf')](shortHash(_0x162a99[_0x11c1fa(0x29b,'Xc[7')](/;$/,''))),_0x357e7c[_0x11c1fa(0x2af,'uW9s')](shortHash(_0x162a99[_0x11c1fa(0x1a3,'@A9S')](/;?$/,';')));}for(const _0x10f58b of _0x569890[_0x11c1fa(0x1b5,'8YC^')]){if(_0x10f58b[_0x11c1fa(0x1ab,'2QHZ')]!==_0x2a4bd9)continue;const _0x4a97b4=_0x10f58b[_0x11c1fa(0x27c,'Dwpf')]===_0x11c1fa(0x1bf,'tZmL')||_0x10f58b[_0x11c1fa(0x266,'uW9s')]===_0x11c1fa(0x1ac,'s6ZW')||_0x10f58b[_0x11c1fa(0x266,'uW9s')]===_0x11c1fa(0x2fb,'pvK@')?!_0x24515f[_0x11c1fa(0x308,'#7C2')](_0x10f58b[_0x11c1fa(0x1a8,'8YC^')]):_0x10f58b[_0x11c1fa(0x20c,'aZ9^')]===_0x11c1fa(0x1dd,'vma2')?!_0x4b6348[_0x11c1fa(0x1b1,'9z%H')](_0x10f58b[_0x11c1fa(0x22f,'uW9s')]):![];if(!_0x4a97b4)continue;_0x473620[_0x11c1fa(0x283,'rpRw')](_0x10f58b['id']),_0x45ac61[_0x11c1fa(0x1d5,'3u[J')][_0x11c1fa(0x2e5,'Xc[7')](toNew(_0x10f58b,_0x5d25cc[_0x11c1fa(0x218,'zVX2')]));}}const _0x2eb373=new Map(_0x569890[_0x11c1fa(0x230,'H^!6')][_0x11c1fa(0x316,'s6ZW')](_0x1d4d90=>[_0x1d4d90['id'],_0x1d4d90]));for(const _0x1648b7 of _0x569890[_0x11c1fa(0x22c,'0aB]')]){if(!_0x473620[_0x11c1fa(0x2ab,'6dx4')](_0x1648b7[_0x11c1fa(0x27e,'Uqxr')]))continue;const _0x4eedc1=_0x2eb373[_0x11c1fa(0x2c3,'8YC^')](_0x1648b7[_0x11c1fa(0x2db,'dOl0')]);if(!_0x4eedc1)continue;if(_0x1648b7[_0x11c1fa(0x2d0,'uW9s')]===_0x11c1fa(0x2e6,'uW9s'))_0x45ac61[_0x11c1fa(0x224,'4q]a')][_0x11c1fa(0x267,'zVX2')]({...toNew(_0x4eedc1,_0x5d25cc[_0x11c1fa(0x1e9,'3@Z2')]),'check':_0x1648b7[_0x11c1fa(0x313,'vma2')],'reason':_0x1648b7[_0x11c1fa(0x1fd,'$pZi')]});else{if(_0x1648b7[_0x11c1fa(0x2b1,'tZmL')]===_0x11c1fa(0x21d,'4q]a'))_0x45ac61[_0x11c1fa(0x22a,'uW9s')]++;else _0x45ac61[_0x11c1fa(0x23f,'rnUo')][_0x11c1fa(0x287,'pvK@')](toNew(_0x4eedc1,_0x5d25cc[_0x11c1fa(0x2cd,'2QHZ')]));}}for(const [_0xe290f0,_0x3720c1]of[['L1',_0x26ef83[_0x11c1fa(0x203,'6dx4')]],['L2',_0x26ef83[_0x11c1fa(0x217,'3@Z2')]]]){for(const _0x5efee3 of _0x3720c1){const _0x242724=_0x5efee3[_0x11c1fa(0x2c1,'638^')][_0x11c1fa(0x2ff,'d#og')](_0x58e8c6=>_0x473620[_0x11c1fa(0x2f1,'s6ZW')](_0x58e8c6['id']));for(const _0x5e7400 of _0x242724){const _0x4345a2=_0x2eb373[_0x11c1fa(0x1ca,'uxVB')](_0x5e7400['id']);if(!_0x4345a2||_0x45ac61[_0x11c1fa(0x24f,'1ROf')][_0x11c1fa(0x22e,'pvK@')](_0x25d971=>_0x25d971['id']===_0x5e7400['id']&&_0x25d971[_0x11c1fa(0x30c,'BPqs')]===_0x5d25cc[_0x11c1fa(0x1ba,'0aB]')]))continue;_0x45ac61[_0x11c1fa(0x2bd,'zVX2')][_0x11c1fa(0x300,'Uqxr')]({...toNew(_0x4345a2,_0x5d25cc[_0x11c1fa(0x2a6,'#7C2')]),'level':_0xe290f0,'with':_0x5efee3[_0x11c1fa(0x1d1,'C[92')][_0x11c1fa(0x1ea,'3u[J')](_0x406fd9=>_0x406fd9['id']!==_0x5e7400['id'])[_0x11c1fa(0x2a3,'tZmL')](_0x17c02b=>_0x17c02b[_0x11c1fa(0x2ac,'Cjpo')]+':'+_0x17c02b[_0x11c1fa(0x219,'RxDv')])[_0x11c1fa(0x226,'2QHZ')](0xcf7*-0x3+0x1*-0x407+0x2aec,-0x130d*-0x1+0x1966+-0x2c7*0x10)});}}}const _0x861695=(_0x23fb77,_0x34d72f)=>{const _0x681488=_0x11c1fa,_0x24fc92=new Map(),_0xddba8a=new Set();for(const _0x268097 of _0x23fb77){if(_0x268097[_0x681488(0x209,'Xc[7')]!==_0x681488(0x24a,'5wu%')||_0x268097[_0x681488(0x231,'0aB]')]!==_0x34d72f)continue;const _0x58a299=_0x268097[_0x681488(0x253,'e6Rk')]+'|'+_0x268097[_0x681488(0x1e3,'8YC^')]+'|'+_0x268097[_0x681488(0x286,'$pZi')];if(_0xddba8a[_0x681488(0x227,'[)o0')](_0x58a299))continue;_0xddba8a[_0x681488(0x2b7,'e6Rk')](_0x58a299);const _0x11db13=_0x24fc92[_0x681488(0x2d3,'Xc[7')](_0x268097[_0x681488(0x25a,'4q]a')])??[];_0x11db13[_0x681488(0x287,'pvK@')](_0x268097),_0x24fc92[_0x681488(0x258,'#7C2')](_0x268097[_0x681488(0x211,'H^!6')],_0x11db13);}return _0x24fc92;},_0xc50967=new Map(),_0x152c1a=new Map();for(const _0x21e70c of Array[_0x11c1fa(0x1f0,'1$pA')](_0x242cba)[_0x11c1fa(0x1cc,'*re9')]()){const _0x51cd45=_0x183737[_0x11c1fa(0x21f,'C[92')](_0x21e70c),_0x29b3e4=_0x51cd45?[..._0x51cd45,..._0x26ef83[_0x11c1fa(0x25b,'uxVB')][_0x11c1fa(0x315,'piHA')](_0x170f4f=>_0x170f4f[_0x11c1fa(0x1ab,'2QHZ')]===_0x21e70c&&!GATE_TYPES[_0x11c1fa(0x215,'IDj&')](_0x170f4f[_0x11c1fa(0x21e,'dyrQ')]))]:_0x26ef83[_0x11c1fa(0x2b5,'BPqs')][_0x11c1fa(0x1bc,'mNd2')](_0x4498dd=>_0x4498dd[_0x11c1fa(0x31b,'uxVB')]===_0x21e70c);for(const [_0x98335f,_0xb1b125]of _0x861695(_0x29b3e4,_0x21e70c))_0xc50967[_0x11c1fa(0x31c,'vma2')](_0x98335f,[..._0xc50967[_0x11c1fa(0x2e8,'e6Rk')](_0x98335f)??[],..._0xb1b125]);for(const [_0x5d6573,_0x77e39a]of _0x861695(_0x331194[_0x11c1fa(0x1d7,'rpRw')](_0x21e70c)??[],_0x21e70c))_0x152c1a[_0x11c1fa(0x2df,'aZ9^')](_0x5d6573,(_0x152c1a[_0x11c1fa(0x2e8,'e6Rk')](_0x5d6573)??0xbe*0x13+-0x21e2+0x13c8)+_0x77e39a[_0x11c1fa(0x1df,'638^')]);}for(const _0x939933 of Array[_0x11c1fa(0x24d,'5wu%')](_0xc50967[_0x11c1fa(0x21a,'Xc[7')]())[_0x11c1fa(0x1b8,'#7C2')]()){const _0x22c3ef=_0xc50967[_0x11c1fa(0x22d,'xG^p')](_0x939933),_0x3e28cd=_0x22c3ef[_0x11c1fa(0x1df,'638^')]-(_0x152c1a[_0x11c1fa(0x291,'Uqxr')](_0x939933)??0x255e+-0x1e57*-0x1+-0x1*0x43b5);if(_0x3e28cd<=0x2*-0x411+-0x1a*-0x2a+-0x2d*-0x16)continue;const _0x476503=_0x939933[_0x11c1fa(0x212,'[)o0')]('|')[-0x18+-0x7*-0x3c7+-0x1a57]??'',_0x1d5a91=_0x22c3ef[_0x11c1fa(0x22b,'Xc[7')](_0x5d159c=>dropLegacy([_0x5d159c],_0x331194[_0x11c1fa(0x319,'gfid')](_0x5d159c[_0x11c1fa(0x262,'BPqs')])??[])[_0x11c1fa(0x1cf,'C[92')]>0x1*0x15a3+-0x1b73+0x5d0)[_0x11c1fa(0x20a,'4q]a')](_0x4d8929=>!(_0x357e7c[_0x11c1fa(0x2dc,'Z!2N')](_0x476503)&&(!_0x331194[_0x11c1fa(0x263,'Xc[7')](_0x4d8929[_0x11c1fa(0x2ee,'xG^p')])||(_0x1ab680[_0x11c1fa(0x1f2,'IDj&')](_0x4d8929[_0x11c1fa(0x1ed,'piHA')])?.[_0x11c1fa(0x206,'H)Mz')](_0x4d8929[_0x11c1fa(0x2d5,'aZ9^')])??![]))))[_0x11c1fa(0x2d1,'tZmL')]((_0x1bfa1f,_0xbd8220)=>_0x1bfa1f[_0x11c1fa(0x2bb,'3u[J')][_0x11c1fa(0x205,'IDj&')](_0xbd8220[_0x11c1fa(0x2b0,'[)o0')])||_0x1bfa1f[_0x11c1fa(0x2cc,'d#og')]-_0xbd8220[_0x11c1fa(0x1fc,'Xc[7')]);for(const _0x5d9340 of _0x1d5a91[_0x11c1fa(0x256,'9z%H')](-0x169e*0x1+0x673+0x102b,_0x3e28cd)){_0x45ac61[_0x11c1fa(0x2cb,'zVX2')][_0x11c1fa(0x1af,'#7C2')]({'constraintId':_0x5d9340[_0x11c1fa(0x1ff,'Xc[7')],'type':_0x5d9340[_0x11c1fa(0x271,'aZ9^')],'message':_0x5d9340[_0x11c1fa(0x2dd,'piHA')],'enforce':_0x5d9340[_0x11c1fa(0x1a2,'Cjpo')],'origin':_0x5d9340[_0x11c1fa(0x1f3,'pvK@')],'severity':_0x5d9340[_0x11c1fa(0x311,'pvK@')],'file':_0x5d9340[_0x11c1fa(0x232,'RxDv')],'line':_0x5d9340[_0x11c1fa(0x26b,'dOl0')],'name':_0x5d9340[_0x11c1fa(0x298,'rnUo')],'root':_0x5d25cc[_0x11c1fa(0x1ba,'0aB]')],'detail':_0x5d9340[_0x11c1fa(0x26e,'pvK@')]});}}}const _0x5f7d9d=_0x34307c=>_0x34307c[_0x11c1fa(0x20d,'e6Rk')]((_0x422756,_0x8e6fea)=>_0x422756[_0x11c1fa(0x2c6,'C[92')][_0x11c1fa(0x2c9,'mNd2')](_0x8e6fea[_0x11c1fa(0x1c3,'uW9s')])||_0x422756[_0x11c1fa(0x1be,'638^')][_0x11c1fa(0x2d8,'pvK@')](_0x8e6fea[_0x11c1fa(0x2d9,'aZ9^')])||_0x422756[_0x11c1fa(0x29f,'2QHZ')]-_0x8e6fea[_0x11c1fa(0x278,'mW9I')]||_0x422756['id'][_0x11c1fa(0x2bf,'3@Z2')](_0x8e6fea['id']));return _0x5f7d9d(_0x45ac61[_0x11c1fa(0x1ae,'8YC^')]),_0x5f7d9d(_0x45ac61[_0x11c1fa(0x245,'j[OY')]),_0x5f7d9d(_0x45ac61[_0x11c1fa(0x222,'piHA')]),_0x5f7d9d(_0x45ac61[_0x11c1fa(0x295,'C[92')]),_0x45ac61[_0x11c1fa(0x1c4,'pvK@')][_0x11c1fa(0x1c9,'2QHZ')]((_0x58edb3,_0x58e962)=>_0x58edb3[_0x11c1fa(0x269,'Cjpo')][_0x11c1fa(0x31f,'BPqs')](_0x58e962[_0x11c1fa(0x30c,'BPqs')])||_0x58edb3[_0x11c1fa(0x1ab,'2QHZ')][_0x11c1fa(0x1d8,'[)o0')](_0x58e962[_0x11c1fa(0x1ab,'2QHZ')])||_0x58edb3[_0x11c1fa(0x1f5,'rpRw')]-_0x58e962[_0x11c1fa(0x30f,'638^')]||_0x58edb3[_0x11c1fa(0x273,'uxVB')][_0x11c1fa(0x310,'638^')](_0x58e962[_0x11c1fa(0x29d,'1ROf')])),_0x45ac61;}function toNew(_0x4b4a83,_0x246881){const _0x270144=a43_0x2d55;return{'id':_0x4b4a83['id'],'kind':_0x4b4a83[_0x270144(0x30d,'uxVB')],'name':_0x4b4a83[_0x270144(0x236,'vma2')],'file':_0x4b4a83[_0x270144(0x1ed,'piHA')],'line':_0x4b4a83[_0x270144(0x304,'zVX2')],'root':_0x246881};}export function enforcedViolations(_0x941d2c){const _0x35fc0d=a43_0x2d55;return _0x941d2c[_0x35fc0d(0x2f5,'piHA')][_0x35fc0d(0x2ea,'rnUo')](_0x3dff83=>_0x3dff83[_0x35fc0d(0x1aa,'Z!2N')]===_0x35fc0d(0x1e1,'@A9S')||_0x3dff83[_0x35fc0d(0x284,'NF4N')]===_0x35fc0d(0x235,'#7C2'));}export const WIRING_CAP=0x255+0x2*-0x861+0xe77;export const STRUCTURE_CAP=0x2369+0x255+-0x25b4;export function wiringScore(_0x4cec0c){const _0x1eff7e=a43_0x2d55;if(!_0x4cec0c)return null;const _0x21552b=_0x4cec0c[_0x1eff7e(0x2b4,'9z%H')][_0x1eff7e(0x1fa,'H)Mz')]+_0x4cec0c[_0x1eff7e(0x26f,'IDj&')][_0x1eff7e(0x268,'mW9I')];if(_0x21552b===-0x9a1+0x8ba+-0x15*-0xb)return null;return Math[_0x1eff7e(0x2f6,'uW9s')](_0x4cec0c[_0x1eff7e(0x213,'uW9s')][_0x1eff7e(0x285,'2nVN')]/_0x21552b*WIRING_CAP);}export function structureScore(_0x518068){const _0x4b83e8=a43_0x2d55;if(!_0x518068||_0x518068[_0x4b83e8(0x2d4,'1ROf')]===0x1670+-0x5*-0x463+-0x1*0x2c5f)return null;if((_0x518068[_0x4b83e8(0x243,'zVX2')]??0x9c4+-0x5*-0x6fa+0x2ca6*-0x1)===-0x1*0x1b72+0x1da0+-0x22e&&_0x518068[_0x4b83e8(0x257,'vma2')][_0x4b83e8(0x1f6,'zVX2')]===-0x1*0x1672+-0x2286*-0x1+0x2*-0x60a)return null;const _0xe34c7c=new Map();for(const _0x47def7 of _0x518068[_0x4b83e8(0x27d,'d#og')]){const _0x6bd32c=_0x47def7[_0x4b83e8(0x2c7,'d#og')]+'|'+_0x47def7['id'];if(_0xe34c7c[_0x4b83e8(0x23e,'3@Z2')](_0x6bd32c)!=='L1')_0xe34c7c[_0x4b83e8(0x2aa,'Uqxr')](_0x6bd32c,_0x47def7[_0x4b83e8(0x21b,'j[OY')]);}const _0x11a0e4=Array[_0x4b83e8(0x2de,'aZ9^')](_0xe34c7c[_0x4b83e8(0x318,'5wu%')]())[_0x4b83e8(0x2f8,'gfid')]((_0x4c1cb2,_0xa04949)=>_0x4c1cb2+(_0xa04949==='L1'?0x16*-0x143+-0x2*-0xfd1+0x2b*-0x17:0x1f46+0x4a8*-0x6+-0x355),-0x22fe+0x1*0x1247+0x10b7*0x1);return Math[_0x4b83e8(0x2fc,'Z!2N')](-0xf0d+-0x1493+-0xbe*-0x30,STRUCTURE_CAP-(-0x15d1*-0x1+0x2*-0x98f+-0x2ae*0x1)*enforcedViolations(_0x518068)[_0x4b83e8(0x292,'3@Z2')]-_0x11a0e4);}export function configTaskSummary(_0x3e96f2,_0x8b2766='P1'){const _0xb1a103=a43_0x2d55;if(!_0x3e96f2||_0x3e96f2[_0xb1a103(0x2b3,'1$pA')]===0x1231*-0x1+-0x1d15+-0xfc2*-0x3)return null;return{'new_ci':_0x3e96f2[_0xb1a103(0x2a8,'mNd2')][_0xb1a103(0x2e1,'IDj&')],'dup':new Set(_0x3e96f2[_0xb1a103(0x2a0,'IDj&')][_0xb1a103(0x201,'Cjpo')](_0x4c2e5f=>_0x4c2e5f['id']))[_0xb1a103(0x1ad,'mNd2')],'unwired':_0x3e96f2[_0xb1a103(0x1e2,'#7C2')][_0xb1a103(0x241,'H^!6')],'struct_violation':enforcedViolations(_0x3e96f2)[_0xb1a103(0x1cf,'C[92')],'phase':_0x8b2766};}export function configTaskSummariesByRoot(_0x15a7e1,_0x219c16='P1'){const _0x29e2e7=a43_0x2d55,_0x463e21={};if(!_0x15a7e1)return _0x463e21;for(const _0xcca30b of Array[_0x29e2e7(0x1f0,'1$pA')](new Set(_0x15a7e1[_0x29e2e7(0x2ed,'Xc[7')]))[_0x29e2e7(0x303,'BPqs')]()){const _0xd306cb=_0x15a7e1[_0x29e2e7(0x24e,'mW9I')]?.[_0xcca30b]??0x1*0x15b5+-0x2*-0x6ec+-0x238d*0x1,_0x36e1c0=_0x19d770=>_0x19d770[_0x29e2e7(0x1c7,'*re9')](_0x531402=>_0x531402[_0x29e2e7(0x2c7,'d#og')]===_0xcca30b),_0x32d0ba={..._0x15a7e1,'maps':[_0xcca30b],'files':_0xd306cb,'newCis':_0x36e1c0(_0x15a7e1[_0x29e2e7(0x2e0,'piHA')]),'wired':_0x36e1c0(_0x15a7e1[_0x29e2e7(0x1a5,'Cjpo')]),'unwired':_0x36e1c0(_0x15a7e1[_0x29e2e7(0x1e6,'uW9s')]),'dup':_0x36e1c0(_0x15a7e1[_0x29e2e7(0x295,'C[92')]),'violations':_0x36e1c0(_0x15a7e1[_0x29e2e7(0x1b7,'6dx4')])},_0x1877d0=configTaskSummary(_0x32d0ba,_0x219c16);if(_0x1877d0)_0x463e21[_0xcca30b]=_0x1877d0;}return _0x463e21;}export function unnecessaryRate(_0x239a5c){const _0x45774f=a43_0x2d55;if(!_0x239a5c||_0x239a5c[_0x45774f(0x259,'Dwpf')]===0x5b2+0x1c89+-0x223b)return null;return Math[_0x45774f(0x293,'BPqs')]((_0x239a5c[_0x45774f(0x280,'2QHZ')]+_0x239a5c[_0x45774f(0x2d2,'e6Rk')])/_0x239a5c[_0x45774f(0x1c0,'Cjpo')]*(-0x1084+-0x1*0xf76+0x11f1*0x2))/(0x12a8+0x25c4+-0x1*0x3484);}export const typeFlagOn=a43_0x560394;export function usageSessionId(){const _0x5d74e5=a43_0x2d55,_0x45fb14=process.env.XDG_RUNTIME_DIR||a43_0x147f98[_0x5d74e5(0x2d6,'Cjpo')](homeDir(),_0x5d74e5(0x2ad,'j[OY'),_0x5d74e5(0x2c2,'1$pA')),_0x21ab94=readJson(a43_0x147f98[_0x5d74e5(0x1c6,'2QHZ')](_0x45fb14,_0x5d74e5(0x2e4,'pvK@'))),_0xb5eee4=typeof _0x21ab94?.[_0x5d74e5(0x28c,'j[OY')]===_0x5d74e5(0x1d0,'mNd2')?_0x21ab94[_0x5d74e5(0x2b6,'1ROf')][_0x5d74e5(0x20f,'rpRw')]():'';return _0xb5eee4?_0xb5eee4[_0x5d74e5(0x1cd,'Z!2N')](0x193a+0x2dd+-0x1c17,0x17d3*0x1+-0x2*0x98d+0x7*-0xab):null;}export function configSummarySession(_0x55ca4d){const _0x3a98a9=a43_0x2d55;if(runnerSessionId())return _0x3a98a9(0x260,'RxDv');return usageSessionId()??(_0x55ca4d||_0x3a98a9(0x2a5,'Z!2N'));}export function emitConfigTaskSummary(_0x3ba19e,_0x1b3aeb=a43_0xfd1c46(0x30b,'uW9s'),_0x3e9c25={}){const _0xf42cb1=a43_0xfd1c46;if(!_0x3ba19e)return![];return emitTypedEvent(_0xf42cb1(0x29a,'mNd2'),{..._0x3ba19e},_0x1b3aeb,_0x3e9c25);}
|
|
1
|
+
/**
|
|
2
|
+
* config-map/task-eval — 태스크 단위 형상 평가 (설계 10 §5.1 ④⑤, §6.1 wiring 판정, §13 북극성).
|
|
3
|
+
*
|
|
4
|
+
* 입력 = 태스크가 편집한 파일(절대 경로) + 레포별 태스크 시작 HEAD(taskStartHead).
|
|
5
|
+
* 신규 CI = 편집 파일의 지도 CI 중 taskStartHead 시점 파일(`git show <sha>:<path>`, 파일 단위 — checkout 금지)에 없던 선언·라우트.
|
|
6
|
+
* - 미연결 = 신규 CI 의 wiring 판정이 violated(확정). unknown 은 세지 않는다(P-5).
|
|
7
|
+
* - 중복 = 신규 CI 가 감사의 L1/L2 클러스터 멤버.
|
|
8
|
+
* - 구조 위반 = 편집 파일의 제약 위반 중 키의 bodyHash(또는 줄 해시)가 시작 시점 파일에 없고, 편집 안 한 파일의 같은 키도 아닌 것
|
|
9
|
+
* (경로 없는 키 차집합 — 이동은 새 위반이 아니다, §4.1). 그리고 **레거시 판정(gate ② 와 같은 규칙, shape-eval.dropLegacy)**:
|
|
10
|
+
* 시작 시점 파일을 경량층(light-eval)으로 평가한 위반에 같은 선언·같은 제약·같은 대상 위반이 있으면 레거시 — 기존 위반 함수의
|
|
11
|
+
* 본문만 고친 편집은 새 위반 0.
|
|
12
|
+
* 지도가 없는 레포의 파일은 평가하지 않는다(지도 부재 = 무판정). 정밀층(ts-morph) 사용 — MCP·백그라운드 전용, 훅 금지.
|
|
13
|
+
*
|
|
14
|
+
* 북극성 `config_task_summary` 는 이벤트 방출을 타입 플래그(remote-flags `raw_type_config_task_summary`, 기본 off)
|
|
15
|
+
* 뒤에서 방출 시점 판정한다(§9 — 서버 미배포 동안 append 자체를 하지 않는다).
|
|
16
|
+
*/
|
|
17
|
+
import * as fs from 'fs';
|
|
18
|
+
import * as path from 'path';
|
|
19
|
+
import { spawnSync } from 'child_process';
|
|
20
|
+
import { GIT_SAFE } from '../changeset.js';
|
|
21
|
+
import { buildWorkspace } from './store.js';
|
|
22
|
+
import { computeAudit } from './audit.js';
|
|
23
|
+
import { extractDecls } from './decls.js';
|
|
24
|
+
import { maskSource, shortHash } from './hash.js';
|
|
25
|
+
import { dropLegacy, effective } from './shape-eval.js';
|
|
26
|
+
import { fileFindings, GATE_TYPES } from './light-eval.js';
|
|
27
|
+
import { DEFAULT_ROLES } from './shape.js';
|
|
28
|
+
import { locateMap, readTracker, realpathLoose, knowledgeDir, readJson, typeFlagOn as typeFlagOnShared, emitTypedEvent, runnerSessionId, homeDir } from './index-store.js';
|
|
29
|
+
/** 기본: edit-tracker heads → task-heads.json (changeset.taskStartHead 와 같은 우선순위, git spawn 없이) */
|
|
30
|
+
export function trackerHeads() {
|
|
31
|
+
const t = readTracker();
|
|
32
|
+
const th = readJson(path.join(knowledgeDir(), 'task-heads.json')) ?? {};
|
|
33
|
+
return (top) => t.heads[top] ?? (typeof th[top] === 'string' ? th[top] : null);
|
|
34
|
+
}
|
|
35
|
+
/** `git show <sha>:<path>` — 그 시점에 없던 파일이면 '', git 실패(판정 불가)면 null */
|
|
36
|
+
export function fileAtHead(toplevel, sha, fileAbs) {
|
|
37
|
+
const rel = path.relative(toplevel, fileAbs).split(path.sep).join('/');
|
|
38
|
+
if (rel.startsWith('..'))
|
|
39
|
+
return null;
|
|
40
|
+
const r = spawnSync('git', ['show', `${sha}:${rel}`], { cwd: toplevel, encoding: 'utf-8', maxBuffer: 32 * 1024 * 1024, timeout: 15_000 });
|
|
41
|
+
if (r.status === 0)
|
|
42
|
+
return r.stdout;
|
|
43
|
+
const err = String(r.stderr ?? '');
|
|
44
|
+
if (/exists on disk, but not in|does not exist in|path '.*' does not exist/i.test(err))
|
|
45
|
+
return '';
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const SRC_EXT_RE = /\.(tsx?|jsx?|mjs|cjs|mts|cts)$/;
|
|
49
|
+
/**
|
|
50
|
+
* 태스크 시작 HEAD 대비 지도 루트 아래에서 **삭제된** 소스 파일(절대 경로, 정렬) — `git diff --name-only --no-renames --diff-filter=D <head>`.
|
|
51
|
+
* Bash `rm`/`git rm`/`mv` 로 지운 원본은 edit-tracker 에 없을 수 있다 — 이동(새 위치 Write + 원본 rm)의 원본이 빠지면
|
|
52
|
+
* 키 다중도가 늘어 복사로 오판되므로 평가 대상에 넣는다(시작 시점 본문 = pre, 현재 = 없음). --no-renames: `git mv`(staged) 도 D 로.
|
|
53
|
+
* git 실패 = [](보수적: 이동이 복사로 남을 수 있지만 평가는 계속).
|
|
54
|
+
*/
|
|
55
|
+
export function deletedSinceHead(toplevel, sha, root) {
|
|
56
|
+
const rootRel = path.relative(toplevel, root).split(path.sep).join('/');
|
|
57
|
+
if (rootRel.startsWith('..'))
|
|
58
|
+
return [];
|
|
59
|
+
const r = spawnSync('git', [...GIT_SAFE, '-C', toplevel, 'diff', '--name-only', '--no-renames', '--diff-filter=D', '-z', sha, '--', rootRel || '.'], { encoding: 'utf-8', maxBuffer: 16 * 1024 * 1024, timeout: 15_000 });
|
|
60
|
+
if (r.status !== 0)
|
|
61
|
+
return [];
|
|
62
|
+
return String(r.stdout ?? '').split('\0').filter(x => x && SRC_EXT_RE.test(x)).map(x => path.join(toplevel, x)).sort();
|
|
63
|
+
}
|
|
64
|
+
/** 없는 경로의 가장 가까운 존재 조상 디렉터리(삭제 파일의 지도 판정용) */
|
|
65
|
+
function existingAncestor(p) {
|
|
66
|
+
let d = path.dirname(p);
|
|
67
|
+
for (let i = 0; i < 64 && !fs.existsSync(d); i++) {
|
|
68
|
+
const up = path.dirname(d);
|
|
69
|
+
if (up === d)
|
|
70
|
+
break;
|
|
71
|
+
d = up;
|
|
72
|
+
}
|
|
73
|
+
return d;
|
|
74
|
+
}
|
|
75
|
+
export function evaluateTaskFiles(filesAbs, heads = trackerHeads()) {
|
|
76
|
+
// 지도별로 묶기
|
|
77
|
+
const groups = new Map();
|
|
78
|
+
for (const f of Array.from(new Set(filesAbs)).sort()) {
|
|
79
|
+
if (!SRC_EXT_RE.test(f))
|
|
80
|
+
continue;
|
|
81
|
+
const abs = realpathLoose(f);
|
|
82
|
+
const loc = locateMap(abs);
|
|
83
|
+
if (!loc)
|
|
84
|
+
continue;
|
|
85
|
+
// worktree(읽기 전용 매핑)는 재추출하지 않는다 — 메인 지도 오염 방지(설계 11 §1)
|
|
86
|
+
if (loc.toplevel !== loc.mapTop)
|
|
87
|
+
continue;
|
|
88
|
+
const g = groups.get(loc.storeDir) ?? { root: loc.root, toplevel: loc.toplevel, files: [] };
|
|
89
|
+
g.files.push(abs);
|
|
90
|
+
groups.set(loc.storeDir, g);
|
|
91
|
+
}
|
|
92
|
+
if (!groups.size)
|
|
93
|
+
return null;
|
|
94
|
+
// 시작 HEAD 대비 삭제된 원본(Bash rm·mv 등, tracker 밖)도 같은 지도의 평가 대상 — 이동 판정(키 다중도)이 원본 소멸을 보게
|
|
95
|
+
for (const [storeDir, g] of groups) {
|
|
96
|
+
const sha = heads(g.toplevel, g.root);
|
|
97
|
+
if (!sha)
|
|
98
|
+
continue;
|
|
99
|
+
for (const abs of deletedSinceHead(g.toplevel, sha, g.root)) {
|
|
100
|
+
if (g.files.includes(abs))
|
|
101
|
+
continue;
|
|
102
|
+
const loc = locateMap(existingAncestor(abs));
|
|
103
|
+
if (loc && loc.storeDir === storeDir)
|
|
104
|
+
g.files.push(abs);
|
|
105
|
+
}
|
|
106
|
+
g.files.sort();
|
|
107
|
+
}
|
|
108
|
+
const res = { maps: [], files: 0, rootFiles: {}, newCis: [], wired: [], unwired: [], unknownWiring: 0, dup: [], violations: [], enforcedConstraints: 0, newL1Growth: 0 };
|
|
109
|
+
for (const g of Array.from(groups.values()).sort((a, b) => a.root.localeCompare(b.root))) {
|
|
110
|
+
const ws = buildWorkspace(g.root);
|
|
111
|
+
const audit = computeAudit(ws);
|
|
112
|
+
const m = ws.members[0];
|
|
113
|
+
if (!m)
|
|
114
|
+
continue;
|
|
115
|
+
res.maps.push(g.root);
|
|
116
|
+
const preHashes = new Set();
|
|
117
|
+
const changedRels = new Set();
|
|
118
|
+
// 레거시 판정용 pre 위반(경량층, 파일별) — gate ② 와 같은 함수·같은 서명(shape-eval.legacySig)
|
|
119
|
+
const preFindings = new Map();
|
|
120
|
+
const postFindings = new Map();
|
|
121
|
+
const constraints = ws.baseline.constraints ?? [];
|
|
122
|
+
res.enforcedConstraints += constraints.filter(c => { const e = effective(c).enforce; return e === 'complete' || e === 'block'; }).length;
|
|
123
|
+
const roles = { ...DEFAULT_ROLES, ...(ws.baseline.roles ?? {}) };
|
|
124
|
+
const canonical = (role) => (ws.baseline.canonical ?? []).filter(k => k.role === role && k.ci).map(k => k.ci);
|
|
125
|
+
const newIds = new Set();
|
|
126
|
+
const preNamesByFile = new Map();
|
|
127
|
+
// newL1Growth: 평가 파일(pre 판정 가능)의 bodyHash 다중도. pre·post 모두 extractDecls 로 재서 비교 기준을 맞춘다
|
|
128
|
+
const prePosts = new Map();
|
|
129
|
+
const countDecls = (text, side) => {
|
|
130
|
+
for (const x of extractDecls(text, { aliasPrefixes: ws.builds[0]?.aliasPrefixes }).decls) {
|
|
131
|
+
const v = prePosts.get(x.bodyHash) ?? { pre: 0, post: 0 };
|
|
132
|
+
v[side]++;
|
|
133
|
+
prePosts.set(x.bodyHash, v);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
for (const abs of g.files) {
|
|
137
|
+
const rel = path.relative(g.root, abs).split(path.sep).join('/');
|
|
138
|
+
const sha = heads(g.toplevel, abs);
|
|
139
|
+
const pre = sha ? fileAtHead(g.toplevel, sha, abs) : null;
|
|
140
|
+
if (pre === null)
|
|
141
|
+
continue; // 시작 시점 판정 불가 = unknown (세지 않음)
|
|
142
|
+
changedRels.add(rel);
|
|
143
|
+
res.files++;
|
|
144
|
+
countDecls(pre, 'pre');
|
|
145
|
+
try {
|
|
146
|
+
countDecls(fs.readFileSync(abs, 'utf-8'), 'post');
|
|
147
|
+
}
|
|
148
|
+
catch { /* 삭제된 원본 = post 0 */ }
|
|
149
|
+
res.rootFiles[g.root] = (res.rootFiles[g.root] ?? 0) + 1;
|
|
150
|
+
const d = extractDecls(pre, { aliasPrefixes: ws.builds[0]?.aliasPrefixes });
|
|
151
|
+
if (constraints.length) {
|
|
152
|
+
const holders = () => m.cis.filter(c => c.file !== rel && (c.ext?.length ?? 0) > 0 && (c.kind === 'symbol' || c.kind === 'component' || c.kind === 'model'))
|
|
153
|
+
.map(c => ({ id: c.id, kind: c.kind, file: c.file, name: c.name, line: c.line, endLine: c.endLine, layer: c.layer, bodyHash: c.bodyHash, ext: c.ext }));
|
|
154
|
+
const ctx = { root: g.root, rel, layer: m.layerOf(rel), layerOf: (r) => m.layerOf(r), aliasPrefixes: ws.builds[0]?.aliasPrefixes };
|
|
155
|
+
try {
|
|
156
|
+
preFindings.set(rel, fileFindings(constraints, { ctx, text: pre, decls: d, roles, holders, canonical }));
|
|
157
|
+
}
|
|
158
|
+
catch { /* 평가 실패 = 레거시 판정 생략(보수적: 새 위반으로 남는다) */ }
|
|
159
|
+
// post(현재 파일) 도 같은 경량층으로 — 감사(audit)는 같은 파일의 같은 키를 1건으로 접어(shape.evaluateMember) 같은 파일 안 사본의 다중도가 안 보인다
|
|
160
|
+
try {
|
|
161
|
+
const post = fs.readFileSync(abs, 'utf-8');
|
|
162
|
+
postFindings.set(rel, fileFindings(constraints, { ctx, text: post, decls: extractDecls(post, { aliasPrefixes: ws.builds[0]?.aliasPrefixes }), roles, holders, canonical }));
|
|
163
|
+
}
|
|
164
|
+
catch { /* 감사 결과로 대체 */ }
|
|
165
|
+
}
|
|
166
|
+
const preNames = new Set(d.decls.map(x => x.name));
|
|
167
|
+
preNamesByFile.set(rel, preNames);
|
|
168
|
+
const preRoutes = new Set(d.routes.map(r => `${r.method} ${r.path}`));
|
|
169
|
+
for (const x of d.decls)
|
|
170
|
+
preHashes.add(x.bodyHash);
|
|
171
|
+
for (const ln of maskSource(pre).masked.split('\n'))
|
|
172
|
+
preHashes.add('line:' + shortHash(ln.replace(/\s+/g, ' ').trim()));
|
|
173
|
+
// 소유 선언 없는 import 의 위반 키 = import 문 해시(extract.ts stmtHash 와 같은 정규화)
|
|
174
|
+
for (const mm of pre.matchAll(/^\s*import\b[^;'"]*?(?:from\s*)?['"][^'"]+['"]\s*;?/gm)) {
|
|
175
|
+
const t = mm[0].trim().replace(/\s+/g, ' ');
|
|
176
|
+
preHashes.add(shortHash(t));
|
|
177
|
+
preHashes.add(shortHash(t.replace(/;$/, '')));
|
|
178
|
+
preHashes.add(shortHash(t.replace(/;?$/, ';')));
|
|
179
|
+
}
|
|
180
|
+
for (const ci of m.cis) {
|
|
181
|
+
if (ci.file !== rel)
|
|
182
|
+
continue;
|
|
183
|
+
const isNew = (ci.kind === 'symbol' || ci.kind === 'component' || ci.kind === 'model') ? !preNames.has(ci.name)
|
|
184
|
+
: ci.kind === 'route' ? !preRoutes.has(ci.name) : false;
|
|
185
|
+
if (!isNew)
|
|
186
|
+
continue;
|
|
187
|
+
newIds.add(ci.id);
|
|
188
|
+
res.newCis.push(toNew(ci, g.root));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const byId = new Map(m.cis.map(c => [c.id, c]));
|
|
192
|
+
for (const w of m.wiring) {
|
|
193
|
+
if (!newIds.has(w.ciId))
|
|
194
|
+
continue;
|
|
195
|
+
const ci = byId.get(w.ciId);
|
|
196
|
+
if (!ci)
|
|
197
|
+
continue;
|
|
198
|
+
if (w.status === 'violated')
|
|
199
|
+
res.unwired.push({ ...toNew(ci, g.root), check: w.check, reason: w.reason });
|
|
200
|
+
else if (w.status === 'unknown')
|
|
201
|
+
res.unknownWiring++;
|
|
202
|
+
else
|
|
203
|
+
res.wired.push(toNew(ci, g.root));
|
|
204
|
+
}
|
|
205
|
+
// 현재 멤버 2개 이상인 L1 묶음만 센다(새 함수 0→1 은 0). 묶음 해시 접미 `~n` 은 안전 분할 표시라 bodyHash 로 되돌린다
|
|
206
|
+
const l1Hashes = new Set(audit.dupL1.filter(c => c.members.length >= 2).map(c => c.hash.replace(/~\d+$/, '')));
|
|
207
|
+
for (const h of l1Hashes) {
|
|
208
|
+
const v = prePosts.get(h);
|
|
209
|
+
if (v && v.post > v.pre)
|
|
210
|
+
res.newL1Growth += v.post - v.pre;
|
|
211
|
+
}
|
|
212
|
+
for (const [level, clusters] of [['L1', audit.dupL1], ['L2', audit.dupL2]]) {
|
|
213
|
+
for (const c of clusters) {
|
|
214
|
+
const mine = c.members.filter(x => newIds.has(x.id));
|
|
215
|
+
for (const x of mine) {
|
|
216
|
+
const ci = byId.get(x.id);
|
|
217
|
+
if (!ci || res.dup.some(d => d.id === x.id && d.root === g.root))
|
|
218
|
+
continue;
|
|
219
|
+
res.dup.push({ ...toNew(ci, g.root), level, with: c.members.filter(o => o.id !== x.id).map(o => `${o.file}:${o.line}`).slice(0, 3) });
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
const distinct = (xs, rel) => {
|
|
224
|
+
const out = new Map();
|
|
225
|
+
const seenF = new Set();
|
|
226
|
+
for (const f of xs) {
|
|
227
|
+
if (f.status !== 'violated' || f.file !== rel)
|
|
228
|
+
continue;
|
|
229
|
+
const id = `${f.key}|${f.line}|${f.name}`;
|
|
230
|
+
if (seenF.has(id))
|
|
231
|
+
continue;
|
|
232
|
+
seenF.add(id);
|
|
233
|
+
const arr = out.get(f.key) ?? [];
|
|
234
|
+
arr.push(f);
|
|
235
|
+
out.set(f.key, arr);
|
|
236
|
+
}
|
|
237
|
+
return out;
|
|
238
|
+
};
|
|
239
|
+
const postByKey = new Map(); // 편집 파일의 post 위반(키별)
|
|
240
|
+
const preCount = new Map();
|
|
241
|
+
for (const rel of Array.from(changedRels).sort()) {
|
|
242
|
+
// 경량층이 판정하는 ②-가능 4종(GATE_TYPES)은 경량층 post, 그 밖(require-edge 등)은 감사 결과
|
|
243
|
+
const lp = postFindings.get(rel);
|
|
244
|
+
const post = lp ? [...lp, ...audit.constraintFindings.filter(f => f.file === rel && !GATE_TYPES.has(f.type))] : audit.constraintFindings.filter(f => f.file === rel);
|
|
245
|
+
for (const [k, xs] of distinct(post, rel))
|
|
246
|
+
postByKey.set(k, [...(postByKey.get(k) ?? []), ...xs]);
|
|
247
|
+
for (const [k, xs] of distinct(preFindings.get(rel) ?? [], rel))
|
|
248
|
+
preCount.set(k, (preCount.get(k) ?? 0) + xs.length);
|
|
249
|
+
}
|
|
250
|
+
for (const key of Array.from(postByKey.keys()).sort()) {
|
|
251
|
+
const changed = postByKey.get(key);
|
|
252
|
+
const excess = changed.length - (preCount.get(key) ?? 0);
|
|
253
|
+
if (excess <= 0)
|
|
254
|
+
continue;
|
|
255
|
+
const h = key.split('|')[2] ?? '';
|
|
256
|
+
// 새로 생긴 것 = 레거시(같은 선언·제약·대상 위반이 시작 시점에도) 아님 ∧ 시작 시점에 그 파일에 있던 같은 선언(이름·본문)이 아님
|
|
257
|
+
const fresh = changed
|
|
258
|
+
.filter(f => dropLegacy([f], preFindings.get(f.file) ?? []).length > 0)
|
|
259
|
+
.filter(f => !(preHashes.has(h) && (!preFindings.has(f.file) || (preNamesByFile.get(f.file)?.has(f.name) ?? false))))
|
|
260
|
+
.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line);
|
|
261
|
+
for (const f of fresh.slice(0, excess)) {
|
|
262
|
+
res.violations.push({ constraintId: f.constraintId, type: f.type, message: f.message, enforce: f.enforce, origin: f.origin, severity: f.severity, file: f.file, line: f.line, name: f.name, root: g.root, detail: f.detail });
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const sortNew = (xs) => xs.sort((a, b) => a.root.localeCompare(b.root) || a.file.localeCompare(b.file) || a.line - b.line || a.id.localeCompare(b.id));
|
|
267
|
+
sortNew(res.newCis);
|
|
268
|
+
sortNew(res.wired);
|
|
269
|
+
sortNew(res.unwired);
|
|
270
|
+
sortNew(res.dup);
|
|
271
|
+
res.violations.sort((a, b) => a.root.localeCompare(b.root) || a.file.localeCompare(b.file) || a.line - b.line || a.constraintId.localeCompare(b.constraintId));
|
|
272
|
+
return res;
|
|
273
|
+
}
|
|
274
|
+
function toNew(ci, root) {
|
|
275
|
+
return { id: ci.id, kind: ci.kind, name: ci.name, file: ci.file, line: ci.line, root };
|
|
276
|
+
}
|
|
277
|
+
/** 설계 18 T6: 서명된 사람 제약 위반 수 — 강제통과를 막는 값 */
|
|
278
|
+
export function signedViolationCount(ev) {
|
|
279
|
+
return ev ? enforcedViolations(ev).filter(v => v.origin === 'user').length : 0;
|
|
280
|
+
}
|
|
281
|
+
/** ④⑤가 집행하는 위반 = effective enforce ≥ complete */
|
|
282
|
+
export function enforcedViolations(ev) {
|
|
283
|
+
return ev.violations.filter(v => v.enforce === 'complete' || v.enforce === 'block');
|
|
284
|
+
}
|
|
285
|
+
// ── auto_score 차원 (§6.1, §4.1 ⑤) ───────────────────────────────────────
|
|
286
|
+
export const WIRING_CAP = 10;
|
|
287
|
+
export const STRUCTURE_CAP = 10;
|
|
288
|
+
/** wiring: 신규 CI 중 판정된(satisfied|violated) 것의 연결 비율. 판정 대상 0 이면 null(na) */
|
|
289
|
+
export function wiringScore(ev) {
|
|
290
|
+
if (!ev)
|
|
291
|
+
return null;
|
|
292
|
+
const judged = ev.wired.length + ev.unwired.length;
|
|
293
|
+
if (judged === 0)
|
|
294
|
+
return null;
|
|
295
|
+
return Math.round((ev.wired.length / judged) * WIRING_CAP);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* structure: 새 위반(enforce ≥ complete) 1건당 −5, 기존 코드와 겹치는 신규 CI 1개당 L1(동일 구현) −3·L2(형태 유사) −1.
|
|
299
|
+
* 평가된 편집 파일이 없거나, 집행 대상 제약도 신규 CI 도 없으면 null(na) — 잴 것이 없는데 만점을 주지 않는다.
|
|
300
|
+
* (신규 CI 가 있으면 중복 여부는 항상 잴 수 있으므로 제약이 없어도 채점한다)
|
|
301
|
+
*/
|
|
302
|
+
export function structureScore(ev) {
|
|
303
|
+
if (!ev || ev.files === 0)
|
|
304
|
+
return null;
|
|
305
|
+
if ((ev.enforcedConstraints ?? 0) === 0 && ev.newCis.length === 0)
|
|
306
|
+
return null;
|
|
307
|
+
const lvl = new Map();
|
|
308
|
+
for (const d of ev.dup) {
|
|
309
|
+
const k = `${d.root}|${d.id}`;
|
|
310
|
+
if (lvl.get(k) !== 'L1')
|
|
311
|
+
lvl.set(k, d.level);
|
|
312
|
+
}
|
|
313
|
+
const dupPenalty = Array.from(lvl.values()).reduce((a, l) => a + (l === 'L1' ? 3 : 1), 0);
|
|
314
|
+
return Math.max(0, STRUCTURE_CAP - 5 * enforcedViolations(ev).length - dupPenalty);
|
|
315
|
+
}
|
|
316
|
+
export function configTaskSummary(ev, phase = 'P1') {
|
|
317
|
+
if (!ev || ev.files === 0)
|
|
318
|
+
return null;
|
|
319
|
+
return { new_ci: ev.newCis.length, dup: new Set(ev.dup.map(d => d.id)).size, unwired: ev.unwired.length, struct_violation: enforcedViolations(ev).length, phase };
|
|
320
|
+
}
|
|
321
|
+
/** 지도 루트별 요약 — 세션 파일 `task-summaries/<sid>.json` 의 roots 값 (편집 파일 0 인 루트는 없음) */
|
|
322
|
+
export function configTaskSummariesByRoot(ev, phase = 'P1') {
|
|
323
|
+
const out = {};
|
|
324
|
+
if (!ev)
|
|
325
|
+
return out;
|
|
326
|
+
for (const root of Array.from(new Set(ev.maps)).sort()) {
|
|
327
|
+
const files = ev.rootFiles?.[root] ?? 0;
|
|
328
|
+
const pick = (xs) => xs.filter(x => x.root === root);
|
|
329
|
+
const sub = { ...ev, maps: [root], files, newCis: pick(ev.newCis), wired: pick(ev.wired), unwired: pick(ev.unwired), dup: pick(ev.dup), violations: pick(ev.violations) };
|
|
330
|
+
const s = configTaskSummary(sub, phase);
|
|
331
|
+
if (s)
|
|
332
|
+
out[root] = s;
|
|
333
|
+
}
|
|
334
|
+
return out;
|
|
335
|
+
}
|
|
336
|
+
/** 불필요 코드 생성률 = (중복 + 확정 단선) / 신규 CI (P0~P2 분자, §13) — 신규 0 이면 null */
|
|
337
|
+
export function unnecessaryRate(s) {
|
|
338
|
+
if (!s || s.new_ci === 0)
|
|
339
|
+
return null;
|
|
340
|
+
return Math.round(((s.dup + s.unwired) / s.new_ci) * 1000) / 1000;
|
|
341
|
+
}
|
|
342
|
+
/** 타입 플래그(방출 시점 판정) — index-store.typeFlagOn 재수출(기존 호출부 호환) */
|
|
343
|
+
export const typeFlagOn = typeFlagOnShared;
|
|
344
|
+
/**
|
|
345
|
+
* 현재 usage 세션 id — session-start.sh 가 `$RC_RUNDIR/routinecode-session-latest.json` 에 남긴 session_id(앞 12자).
|
|
346
|
+
* RC_RUNDIR = XDG_RUNTIME_DIR || ~/.routinecode/run (훅·failure-tracker 와 같은 해석식). 없으면 null.
|
|
347
|
+
*/
|
|
348
|
+
export function usageSessionId() {
|
|
349
|
+
const dir = process.env.XDG_RUNTIME_DIR || path.join(homeDir(), '.routinecode', 'run');
|
|
350
|
+
const o = readJson(path.join(dir, 'routinecode-session-latest.json'));
|
|
351
|
+
const sid = typeof o?.session_id === 'string' ? o.session_id.trim() : '';
|
|
352
|
+
return sid ? sid.slice(0, 12) : null;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* config_task_summary 의 session — 세션 id 가 있으면 세션 id, 없으면 taskId(현행).
|
|
356
|
+
* 정비 러너(ROUTINECODE_MAINTENANCE=1) 안이면 'unknown' 을 넘겨 emitTypedEvent 의 러너 세션 id 채움 경로가 동작하게 한다
|
|
357
|
+
* (러너 세션 이벤트는 업로드 제외 — 설계 11 §4.2-3. 러너도 session-start 가 latest 파일을 쓰므로 러너 판정을 먼저 한다).
|
|
358
|
+
*/
|
|
359
|
+
export function configSummarySession(taskId) {
|
|
360
|
+
if (runnerSessionId())
|
|
361
|
+
return 'unknown';
|
|
362
|
+
return usageSessionId() ?? (taskId || 'unknown');
|
|
363
|
+
}
|
|
364
|
+
/** emit_raw.py 와 같은 봉투로 append — 플래그(raw_type_config_task_summary) off 면 아무것도 쓰지 않는다 */
|
|
365
|
+
export function emitConfigTaskSummary(s, session = 'unknown', opts = {}) {
|
|
366
|
+
if (!s)
|
|
367
|
+
return false;
|
|
368
|
+
return emitTypedEvent('config_task_summary', { ...s }, session, opts);
|
|
369
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x19e734,_0x479f9e){const _0x162087=a44_0x3ea2,_0x16eef1=_0x19e734();while(!![]){try{const _0x4233b4=-parseInt(_0x162087(0x1bc,'ddk9'))/(0x136c+-0x33b+-0x1030)+-parseInt(_0x162087(0x17f,'1JU4'))/(-0x20e7*-0x1+0x1043+-0x3128)+-parseInt(_0x162087(0x172,'VeqQ'))/(-0x1f62+-0x27*-0x2e+-0x1*-0x1863)*(parseInt(_0x162087(0x1df,'VlD)'))/(0x1205+-0xb*0x337+0x115c))+parseInt(_0x162087(0x1ca,'kJqB'))/(0xf6d*0x2+0xcfe+-0x2bd3)+parseInt(_0x162087(0x1a8,'Y$fH'))/(0x10f4+-0x1a32+0x944)*(parseInt(_0x162087(0x179,'qy6j'))/(0x14e5+0x375+0x1df*-0xd))+-parseInt(_0x162087(0x160,'74eG'))/(-0x16a5+0x2f*0x25+0xfe2)*(parseInt(_0x162087(0x19b,'74eG'))/(0x5*-0x3f+0x20e6+-0x1fa2))+parseInt(_0x162087(0x182,'&pNN'))/(-0x58a+0x1*-0x2466+0x29fa)*(parseInt(_0x162087(0x1b4,'&d02'))/(0xb86+0x1*0x102f+-0x1baa));if(_0x4233b4===_0x479f9e)break;else _0x16eef1['push'](_0x16eef1['shift']());}catch(_0x20400e){_0x16eef1['push'](_0x16eef1['shift']());}}}(a44_0x20c2,0x656aa+0xa7e*-0x8+-0x53f2*-0xf));import*as a44_0xb8d8d4 from'fs';import*as a44_0x4386a1 from'path';import{seedLayerConstraints}from'./shape.js';export function detectFrameworks(_0x8c3616){const _0x1dafac=a44_0x3ea2,_0x1a705f=new Set(),_0x391f49=[_0x1dafac(0x16f,')@sn')];for(const _0x809384 of safeDirs(_0x8c3616)){_0x391f49[_0x1dafac(0x161,'*%mY')](_0x809384+_0x1dafac(0x1b9,'VlD)'));for(const _0x523873 of safeDirs(a44_0x4386a1[_0x1dafac(0x1b0,'TmV(')](_0x8c3616,_0x809384)))_0x391f49[_0x1dafac(0x1af,'7kjS')](_0x809384+'/'+_0x523873+_0x1dafac(0x17d,'lxMA'));}for(const _0xe4db63 of _0x391f49){let _0x358928;try{_0x358928=JSON[_0x1dafac(0x1b5,'mL6E')](a44_0xb8d8d4[_0x1dafac(0x1b6,']LyD')](a44_0x4386a1[_0x1dafac(0x1cf,'*%mY')](_0x8c3616,_0xe4db63),_0x1dafac(0x183,'0z$X')));}catch{continue;}const _0x377c78={..._0x358928[_0x1dafac(0x1b7,'E!6h')]??{},..._0x358928[_0x1dafac(0x1c7,'TmV(')]??{}};if(_0x377c78[_0x1dafac(0x198,'mL6E')])_0x1a705f[_0x1dafac(0x1a7,'*Vg1')](_0x1dafac(0x196,'Vy3u'));if(_0x377c78[_0x1dafac(0x1a6,'*%mY')])_0x1a705f[_0x1dafac(0x19a,')@sn')](_0x1dafac(0x18b,'7l7v'));}return Array[_0x1dafac(0x199,'drbP')](_0x1a705f)[_0x1dafac(0x197,'gCz!')]();}function safeDirs(_0x8f2631){const _0x361969=a44_0x3ea2;try{return a44_0xb8d8d4[_0x361969(0x1d5,']fDH')](_0x8f2631,{'withFileTypes':!![]})[_0x361969(0x1ac,'kJqB')](_0x3d128f=>_0x3d128f[_0x361969(0x1b2,'ddk9')]()&&!_0x3d128f[_0x361969(0x184,'&91Q')][_0x361969(0x1a4,'Vy3u')]('.')&&_0x3d128f[_0x361969(0x15d,'Mziw')]!==_0x361969(0x18d,'gRVi')&&_0x3d128f[_0x361969(0x155,'0z$X')]!==_0x361969(0x177,'gRVi'))[_0x361969(0x16d,'0z$X')](_0x5ba97b=>_0x5ba97b[_0x361969(0x15d,'Mziw')])[_0x361969(0x1db,'*%mY')]();}catch{return[];}}function a44_0x20c2(){const _0x2af6fb=['s8oBW75R','WPnMyqO','WODqW6hcOb3dKNVdQq','WRqzEvpcJWX/AmkXWP0A','W7f4umkseSoAhSo/','iSoRW73dQmoVnhX8v3u','rUUIQ+YFNEYwPUYwICkp7j+W7kgh7zE57ks1d+YxG+UjRoUkIeddUEUoV+YDJ+2gUhlSOk/SNRVRI6ddG+Y1Io2vGEY4K8km','uSk0WQLPnCowW7ZdVH7dJCoVlCof','sSoPWRHlomomjrhdU2bQW50tWOai','vCkqWPFdJW','W6lcMGTIW4ZdPYOj','WPX2WPay','WQNcJdOFW7ZdM8olWRO','W7u1tmk8','aSojDe3cUMZcPSkvomkMWOFcLaldJgOBCa','EwNcO2tcHSoTWRxcMtq','BhXTWPCTW4C','smogW6nVAYy8rq','WQpdKMZcG8oRrW4RW5TcefhcJHfkp3jvh8o9iSoPESkCW69KWOS','E3NdLCoDW6xdVgtdS8k1','uCoAW6PWDJG','kmoQW7xdS8oVnG','msxdQ8khW7xTGQNRN7pSNB3SLilTIkBcLCotWPldQ8kXq8oOqmoDCSkDW5dcPmkC65cGWP/RIB8PW73cVhFcTCowWQVdMxdSLBdSL4FcP+UtSUUjGq','emkMWO1nA03dTwq2','WRvkW5ddH8o1W7VcOmkQlMJdM8kT','WPbMFa','W7iwWOVcM8kIWR3cUSkoba','DxnOWPm+W40WWQSTWRajkq','W5/cV8oPWQNcMrnAW4fdW7pcICofW4dcPd8RW7a','W7apWOJdMSkTWQZcQ8kvr3VdMSkSWRldKLxdSSoHoCoIWRXCmZytWPNcNcW','oSoNWOXGlCktW5RdHs4','BMpcO2tcHCoIWQtcKG','fbfTWOldNq','WQ/dUhNcUGKecLy','nmoZWOZdUCkiW4OpCvu','bcPvhG','dsXcdXi','vCktWPHelCo6W6vvW6S','cCkcWR8PmwuUsmoOc8okWP0','yCkchmozxSocACk0WRj2W4ZdOG','vmkohmotwmom','fSo0W6ddQ0BcLulcISkyWPbLW6FcHG','dv/dJbdcUCotWOldSW','WRvjW5ddG8o6W7JdP8khdLJdMmkuWQy','d0JdKWZcT8odWOi','W5KFWQpdUL/dH2RdV8ozedu','F3tdJ1NcImkYW4XqWOrTW6i9W5lcVa','WOHZAKlcRW','W69RuSkh','7lMn7yY864Ax7yMZW5dSLl/SLQFSHRKgW6xcICoFW4FcQxhRPltcQEYNQ+YGR8oj67A266EV7ksjloYuQ+UlMEUiKmkG4OcNWOXfrsqZrrzFW4RQS6BSNz4','kmoWWO7dU8kbW4iPCeWABgrK','FLKUhSo8W4rY','CSk0WQldISoPdL12Ea','W6moAG8','WPPBW6RcVWpdNG','WRNdH3JdMG','WRJdGKTHW4ddPIyDlSkNie3dJW','dIXcdYf2W6lcMmomnSo6pa','mCo2W7ZdRmoYkhv0','vgpcTMddH8oPWQpdLWhcPSkFW7ZdV8kfFrdcIcv26RMg67otco2gKE2vREUMHtFdUCkEh0LwWR1Oi8oPWPvkWQ7cV1CwdgJQSRBQS44O','fepdHq/cPmon','xgVdNIu','fqX7W5NdMvpcQ8oiDSkI','m0JdMXtdUmokWPtcTZVcHWJcPWmrW7xdTmolW7P96RUI67c+BE2fHo2vKUUMTa','W5BdNWuZWRtdI8oEW619W7VcNGeoWP7dV8odmLNdVoQ4SUUYKHlTHOxTL4VRPRK','WO17WOOFW4G','exdcUJldO0VcVG','A3NdISoz','wmkycSoot8osCG','WRvVimoJ','zhzV','WQ3cG0T+WQpcMCkvWQ9kW5JcPhKW','WQ9Qemo+wmk2WO1sF0a+W6RcKa','W4xcJa8','WPvAW77cSHJdLYldQmoitNRdPWtdOCk6nmkF','WPWIhSoAWPJcKSklltRcNvldRCkVuSowoq','m8o+WP/dTmkeW4Kn','sCoPW5bwy0FdVG','DSorW7rRkJ8QaCoiemo1W4OvWQfwxmkVWPxdGoQ4TUUWKuZTH4ZTLzRRP7S','fmkvvcOdAEYEMaK','b3ZcQZldSKVcMLldQ3W','tSo8W44nzehdOZ4XWPVcLSogWOBcO8kAk3/cQrfTqmkPW5hdSJzKaG','W6SLr8kG','rSkccq','smopbh9zE8kRyLK5cWC','7lMb7y+v64Eh7yIm64MCW5rEFZJdRmkF7yoz65+97j207jEu7yQk66ssW5ZSPOpSOO/dHCovWPBcJ8obdmoRho2uMoYKTCox7jEQ64Q964IYA+kdPclcStZdLGjDBxJcL+2vSoYjV8kMWRX7rSk4WRunmSoC7j6jsGVcPuCzpw7cJCo4W5hcSmkhxo2yVEYFImkg7jkg64UC','WPRdSMBcUamehblRORpSNlpSLjtRKPtcNUQ4VoUZQmou7yAD7zw266A1W4pIGjTudSotzmoV666d7iA87jwRs+YLV+UYLSoO7jYm6RM5WRZRSzJSPyG','WPVdNKPDBcrGWPRdKSo0WQm','iSo2WOhdRSkiW5u','lZ/dUc3dKmk7W6JcLtBcHCkLWOtdGq','W5bbWRVdHSkTWODLbGddNCogW4JdS2ui','xCkwB8kv','WPLAW6xcVG','WOruW77cVHJdNwG','u8o/W6zjEehdUd5ZWORcGa','DCkUWQBdRSk6W44MvG','vCkWW5iRvmkgWOxdMa','tCkbcmoptW','WOiDD8o6dGCjWO3cHCkijwK','WQ/cOSkgW6NdHCkqFmocgSoVW4Pn','WQKdzfldLWO+C8k7WP8l','WR3cMavXW4JdTsGiDmk+FaJcIW','fGX3WOBdL1dcP8kd','W6xcIrz8W4RdUIG','c8k6WPewpXtdRcn9WPpcTSoC','ncrmWQa5W5aZW7i','eSotW4u/pmoxW5HbW4tcHLZcPa','WPpdUSk0WQJcNXKrW4XbW7ddG8kbWO4','FmkUW5Cem8kxW6BdOfRcTZldLCkReMOle8opymkIc3nbpSkdbmkA','W50Xo8oBamk2','bmo8W6pdRSo4kgmW66c67j2Z7jsH65kBv+Q5RUUZOMRTHARTLyNRPzm','c8k9WRBdGv3cLwhcVSoV','W51nWR/dHmoLWPD6qGNdKSol','hmoxkCojWQXdgSknWOyXo0BdQSov','WQjnlvpcTMTfW4KJW7pdV8kgWOq','WPDqW7RcLbtdG2RdOSojw3hdQGNdOCkN','WQKUdCoeWOlcLCkllq','W73dGG01W7/dKSoE','CSkQW53cRmoBWP5FCgq9q09L','dComqJTVj8kkWOS','ACkdfsOVo8oxWOf2W7uSeSo/WP3cU8ohW6SsB+Q4QEUXVgRTHRtTLAhRPju','vmoLW7e','aSojDbtdPNZdUCkCmSoQWOi','W68VvSk6','W4nqWQtdMmkPWOb/rai','pJlcLq7dN8o4WOToWOT3W4z564IGW7xSHR/SOOBcO+UPLUUtGWldTHddQmolkY45nUYuIUYgL+UNU2ZSNipQSOtdQqtRGyVRQjRSPzZRIOZdVEYhUEYHLCoP6RcX7lcQ66snlSkZAWpdQqS+co2wUEUkTW','tSkmkvZcOwVcPmkjmmkWW5ZcKaddIW','W5KFWQpcOXtdGxNdQCoFedu','hI7cNJ3dPhHYd8k0WOT2C10','W4VcTCo6WQ/cLb4fW7zFW63cJW','e8kUWQ7dQ0lcMKpcHSorW5u8WQi','W4yPW4WeW55YWOylWQKDyW','zN1MWOGWW4qWW6SZ','W47cGG0jmsG1WO7dKmopWO7dMCoCW6G','7zMe7j2kh+Y4LU2oKEUgPE2lG+YvIYtSNzNSOBJTLjtSPPbN7jsf64Qf64Qg','W7yVtCkG','BN0fvaFdLsBcGuCteSozESoxW5NdR8kwWP84WRhdIgpdIKFcTa','fepdGaZcO8oeWOldPa','W6ClDuRdOt8jW5TQW43dP8kJWPhdLmkRW7jDWOT1W53dImk5W6eDWRVdImoY','WQhdM1eKWPFdVdCjoCkBvG','WQFdKSoUWR8','dCkkxgikmCkOw3GSf0ldG1NdPCk7yeNcI8kUW6Cv','xCkEWOJdImonWQBdS35DWR3dLJDAW43cLb7dHW','q2xdGYddV3u6','CxJdNSocW7JdVW','6Rok7j2DB+UYV+YuRUUqIGVQS4tSN5pdUoYCK+YNNoYDQthdPh/cHbOs7ygS656q7jYn7jAd7yMl64IzAE2vIUUbN+UMKYJRKBhRIyOe4OcPBoQ7VEYJOrRTGkJRNRBSNiJSL67TIkJRPyWtCWb1uHrc'];a44_0x20c2=function(){return _0x2af6fb;};return a44_0x20c2();}export function expressTemplate(){const _0xb374d9=a44_0x3ea2,_0x505d23={'kind':_0xb374d9(0x173,'Lm6a'),'detail':_0xb374d9(0x1ae,'8WJR')},_0x565aa8=seedLayerConstraints()[_0xb374d9(0x19d,'u9Jm')](_0x3f6314=>({..._0x3f6314,'id':_0x3f6314['id'][_0xb374d9(0x180,'7gCb')](/^seed-/,_0xb374d9(0x1be,'qy6j')),'origin':_0xb374d9(0x158,'&91Q'),'enforce':_0xb374d9(0x168,'jB7('),'source':_0x505d23})),_0x8ca169=[_0xb374d9(0x174,'qu$K'),_0xb374d9(0x159,'Kdje'),_0xb374d9(0x1a1,'ddk9')][_0xb374d9(0x1cd,'lxMA')](_0x28d6e6=>({'id':_0xb374d9(0x1e1,'Y$fH')+_0x28d6e6,'target':{'layer':_0xb374d9(0x178,'gRVi')},'rule':{'type':_0xb374d9(0x1e2,'Mziw'),'to':{'layer':_0x28d6e6}},'severity':_0xb374d9(0x16e,'1JU4'),'enforce':_0xb374d9(0x17c,'mL6E'),'origin':_0xb374d9(0x175,'BAon'),'message':_0xb374d9(0x1a3,'Y$fH')+_0x28d6e6+_0xb374d9(0x15a,'qy6j'),'why':_0xb374d9(0x1c2,'Kdje'),'source':_0x505d23})),_0x35bbb7={'id':_0xb374d9(0x1dc,'EA5E'),'target':{},'rule':{'type':_0xb374d9(0x1d2,'o7Kx'),'pattern':_0xb374d9(0x19f,'GSsj'),'except':[_0xb374d9(0x1d6,'lxMA'),_0xb374d9(0x1bf,']fDH'),_0xb374d9(0x19c,'*%mY'),_0xb374d9(0x1cb,'*Vg1'),_0xb374d9(0x1d3,'TmV('),_0xb374d9(0x16b,'ddk9'),_0xb374d9(0x18c,'VlD)'),_0xb374d9(0x181,'TmV('),_0xb374d9(0x1ce,'o7Kx'),_0xb374d9(0x1d7,'@KTO')]},'severity':_0xb374d9(0x1b1,'TmV('),'enforce':_0xb374d9(0x1c1,'A)6%'),'origin':_0xb374d9(0x15e,'VlD)'),'message':_0xb374d9(0x1d1,'&pNN'),'why':_0xb374d9(0x1aa,'BAon'),'source':_0x505d23};return[..._0x565aa8,..._0x8ca169,_0x35bbb7];}export function nextTemplate(){const _0x2797e1=a44_0x3ea2,_0x36ecd7={'kind':_0x2797e1(0x156,'TmV('),'detail':_0x2797e1(0x15c,'F4Cl')},_0x1817c9=[_0x2797e1(0x1d4,'!Q)m'),_0x2797e1(0x192,'qu$K'),_0x2797e1(0x162,'o7Kx')];return[{'id':_0x2797e1(0x1c0,'VeqQ'),'target':{'layer':_0x2797e1(0x163,'Lm6a')},'rule':{'type':_0x2797e1(0x19e,'TmV('),'to':{'pkg':[_0x2797e1(0x195,'@KTO'),'ky']}},'severity':_0x2797e1(0x1d0,'8WJR'),'enforce':_0x2797e1(0x152,'gCz!'),'origin':_0x2797e1(0x1ba,'qu$K'),'message':_0x2797e1(0x1a9,'8WJR'),'why':_0x2797e1(0x18f,'Lm6a'),'source':_0x36ecd7},{'id':_0x2797e1(0x1a5,'ddk9'),'target':{'layer':_0x2797e1(0x1d8,')@sn')},'rule':{'type':_0x2797e1(0x1d9,'u9Jm'),'pattern':_0x2797e1(0x17b,'mL6E')},'severity':_0x2797e1(0x187,'aOmo'),'enforce':_0x2797e1(0x164,')@sn'),'origin':_0x2797e1(0x165,'jB7('),'message':_0x2797e1(0x185,']fDH'),'why':_0x2797e1(0x1a2,'jB7('),'source':_0x36ecd7},{'id':_0x2797e1(0x1de,'ih82'),'target':{},'rule':{'type':_0x2797e1(0x176,'kJqB'),'role':_0x2797e1(0x1c4,'8WJR'),'glob':_0x1817c9},'severity':_0x2797e1(0x1e3,'!Q)m'),'enforce':_0x2797e1(0x169,'Kdje'),'origin':_0x2797e1(0x17e,'7gCb'),'message':_0x2797e1(0x16a,'22*I'),'why':_0x2797e1(0x194,'74eG'),'source':_0x36ecd7},{'id':_0x2797e1(0x171,'1JU4'),'target':{},'rule':{'type':_0x2797e1(0x157,'0J%o'),'role':_0x2797e1(0x1b8,'0J%o'),'max':0x1},'severity':_0x2797e1(0x1a0,'kJqB'),'enforce':_0x2797e1(0x18a,'TmV('),'origin':_0x2797e1(0x15e,'VlD)'),'message':_0x2797e1(0x153,'drbP'),'why':_0x2797e1(0x193,'7gCb'),'source':_0x36ecd7},{'id':_0x2797e1(0x166,'7l7v'),'target':{'layer':_0x2797e1(0x191,'!Q)m')},'rule':{'type':_0x2797e1(0x170,']fDH'),'to':{'layer':_0x2797e1(0x167,'gCz!')}},'severity':_0x2797e1(0x1bb,'VlD)'),'enforce':_0x2797e1(0x190,'7gCb'),'origin':_0x2797e1(0x18e,'Kdje'),'message':_0x2797e1(0x1da,'&91Q'),'why':_0x2797e1(0x1cc,'*Vg1'),'source':_0x36ecd7}];}function a44_0x3ea2(_0x28ed7a,_0x343c9c){_0x28ed7a=_0x28ed7a-(-0x872+0x20*0x7b+-0x167*0x4);const _0x249bdd=a44_0x20c2();let _0x4ecefc=_0x249bdd[_0x28ed7a];if(a44_0x3ea2['ecVzJt']===undefined){var _0x334330=function(_0x3ee331){const _0x326ee6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2e2383='',_0x3d83ac='';for(let _0x2ef929=-0x277+0x188e+-0x46b*0x5,_0x29aa36,_0x390f5f,_0x583237=-0x1169+-0x7bb*-0x1+0x3*0x33a;_0x390f5f=_0x3ee331['charAt'](_0x583237++);~_0x390f5f&&(_0x29aa36=_0x2ef929%(0x1de*-0x11+-0xaf7*-0x1+0x1*0x14cb)?_0x29aa36*(-0x59d+-0x42*-0x17+0x11*-0x1)+_0x390f5f:_0x390f5f,_0x2ef929++%(0xe6f+-0x476+0x9f5*-0x1))?_0x2e2383+=String['fromCharCode'](-0x242d+-0x6*0x239+0x3282&_0x29aa36>>(-(-0x1*-0x18cd+0x1ecc*0x1+-0x3797)*_0x2ef929&-0x19ed+-0x1*0x2637+0x402a)):-0x2287+-0x344*-0xa+-0x1*-0x1df){_0x390f5f=_0x326ee6['indexOf'](_0x390f5f);}for(let _0x466f6d=0x25b4*-0x1+0x48c+0x2128,_0x8d0c09=_0x2e2383['length'];_0x466f6d<_0x8d0c09;_0x466f6d++){_0x3d83ac+='%'+('00'+_0x2e2383['charCodeAt'](_0x466f6d)['toString'](0x2275*-0x1+-0x2405+0x468a*0x1))['slice'](-(0x13db+0x2454+0x1*-0x382d));}return decodeURIComponent(_0x3d83ac);};const _0x892802=function(_0x19e734,_0x479f9e){let _0x16eef1=[],_0x4233b4=-0x1ef5+-0xf*0x132+0x5*0x9c7,_0x20400e,_0x581aa1='';_0x19e734=_0x334330(_0x19e734);let _0x22d68d;for(_0x22d68d=0xf93*-0x2+0xe6f+0x10b7;_0x22d68d<-0x1e23+-0x514+0x49*0x7f;_0x22d68d++){_0x16eef1[_0x22d68d]=_0x22d68d;}for(_0x22d68d=0x231a+-0x165d+-0xcbd*0x1;_0x22d68d<-0xa*0x323+-0xb5*0x25+0x1*0x3a87;_0x22d68d++){_0x4233b4=(_0x4233b4+_0x16eef1[_0x22d68d]+_0x479f9e['charCodeAt'](_0x22d68d%_0x479f9e['length']))%(0x136c+-0x33b+-0xf31),_0x20400e=_0x16eef1[_0x22d68d],_0x16eef1[_0x22d68d]=_0x16eef1[_0x4233b4],_0x16eef1[_0x4233b4]=_0x20400e;}_0x22d68d=-0x20e7*-0x1+0x1043+-0x312a,_0x4233b4=-0x1f62+-0x27*-0x2e+-0xf*-0x1a0;for(let _0x31062c=0x1205+-0xb*0x337+0x1158;_0x31062c<_0x19e734['length'];_0x31062c++){_0x22d68d=(_0x22d68d+(0xf6d*0x2+0xcfe+-0x2bd7))%(0x10f4+-0x1a32+0xa3e),_0x4233b4=(_0x4233b4+_0x16eef1[_0x22d68d])%(0x14e5+0x375+0x7a*-0x31),_0x20400e=_0x16eef1[_0x22d68d],_0x16eef1[_0x22d68d]=_0x16eef1[_0x4233b4],_0x16eef1[_0x4233b4]=_0x20400e,_0x581aa1+=String['fromCharCode'](_0x19e734['charCodeAt'](_0x31062c)^_0x16eef1[(_0x16eef1[_0x22d68d]+_0x16eef1[_0x4233b4])%(-0x16a5+0x2f*0x25+0x10da)]);}return _0x581aa1;};a44_0x3ea2['gqnkFy']=_0x892802,a44_0x3ea2['wgBwLi']={},a44_0x3ea2['ecVzJt']=!![];}const _0x2d2168=_0x249bdd[0x5*-0x3f+0x20e6+-0x1fab],_0x3dc071=_0x28ed7a+_0x2d2168,_0x4370b7=a44_0x3ea2['wgBwLi'][_0x3dc071];return!_0x4370b7?(a44_0x3ea2['uIixIo']===undefined&&(a44_0x3ea2['uIixIo']=!![]),_0x4ecefc=a44_0x3ea2['gqnkFy'](_0x4ecefc,_0x343c9c),a44_0x3ea2['wgBwLi'][_0x3dc071]=_0x4ecefc):_0x4ecefc=_0x4370b7,_0x4ecefc;}export function templatesFor(_0x5edefe){const _0x1cbe58=a44_0x3ea2,_0x123213=[];if(_0x5edefe[_0x1cbe58(0x1dd,'7gCb')](_0x1cbe58(0x1c9,'74eG')))_0x123213[_0x1cbe58(0x15f,'@KTO')](...expressTemplate());if(_0x5edefe[_0x1cbe58(0x1c8,'GSsj')](_0x1cbe58(0x1e0,'%3kP')))_0x123213[_0x1cbe58(0x189,'ih82')](...nextTemplate());return _0x123213[_0x1cbe58(0x154,'jB7(')]((_0x47e4f9,_0x5429f8)=>_0x47e4f9['id'][_0x1cbe58(0x186,'kJqB')](_0x5429f8['id']));}
|
|
1
|
+
import*as a41a from'fs';import*as a41b from'path';import{seedLayerConstraints}from'./shape.js';export function detectFrameworks(a){const b=new Set(),c=['package.json'];for(const d of safeDirs(a)){c['push'](d+'/package.json');for(const e of safeDirs(a41b['join'](a,d)))c['push'](d+'/'+e+'/package.json');}for(const f of c){let g;try{g=JSON['parse'](a41a['readFileSync'](a41b['join'](a,f),'utf-8'));}catch{continue;}const h={...g['dependencies']??{},...g['devDependencies']??{}};if(h['express'])b['add']('express');if(h['next'])b['add']('next');}return Array['from'](b)['sort']();}function safeDirs(a){try{return a41a['readdirSync'](a,{'withFileTypes':!![]})['filter'](b=>b['isDirectory']()&&!b['name']['startsWith']('.')&&b['name']!=='node_modules'&&b['name']!=='dist')['map'](b=>b['name'])['sort']();}catch{return[];}}export function expressTemplate(){const a={'kind':'template','detail':'express-layered'},b=seedLayerConstraints()['map'](e=>({...e,'id':e['id']['replace'](/^seed-/,'tpl-express-'),'origin':'proposed','enforce':'inform','source':a})),c=['route','controller','service']['map'](e=>({'id':'tpl-express-model-not-'+e,'target':{'layer':'model'},'rule':{'type':'forbid-dependency','to':{'layer':e}},'severity':'violation','enforce':'inform','origin':'proposed','message':'model\x20은\x20'+e+'\x20레이어에\x20의존하지\x20않는다\x20(데이터\x20정의는\x20최하층)','why':'Express\x20레이어드\x20기본\x20템플릿','source':a})),d={'id':'tpl-express-env-in-config','target':{},'rule':{'type':'forbid-pattern','pattern':'\x5cbprocess\x5c.env\x5c.','except':['**/config/**','**/configs/**','**/*.config.*','**/env.*','**/server.*','**/main.*','**/scripts/**','**/*.test.*','**/*.spec.*','**/tests/**']},'severity':'warning','enforce':'inform','origin':'proposed','message':'process.env\x20는\x20설정\x20모듈(config/)에서만\x20읽고,\x20나머지는\x20설정\x20객체를\x20import\x20한다','why':'Express\x20레이어드\x20기본\x20템플릿\x20—\x20env\x20미선언·중복\x20읽기\x20방지','source':a};return[...b,...c,d];}export function nextTemplate(){const a={'kind':'template','detail':'next-app-router'},b=['**/src/api/**','src/api/**','**/src/lib/api/**'];return[{'id':'tpl-next-component-no-axios','target':{'layer':'component'},'rule':{'type':'forbid-dependency','to':{'pkg':['axios','ky']}},'severity':'violation','enforce':'inform','origin':'proposed','message':'컴포넌트는\x20HTTP\x20클라이언트를\x20직접\x20import\x20하지\x20않는다\x20—\x20src/api\x20함수\x20+\x20hooks\x20의\x20React\x20Query\x20훅을\x20쓴다','why':'Next.js\x20App\x20Router\x20기본\x20템플릿\x20(src/api\x20·\x20hooks\x20경계)','source':a},{'id':'tpl-next-component-no-fetch','target':{'layer':'component'},'rule':{'type':'forbid-pattern','pattern':'\x5cbfetch\x5cs*\x5c('},'severity':'warning','enforce':'inform','origin':'proposed','message':'컴포넌트\x20안에서\x20fetch\x20를\x20직접\x20부르지\x20않는다\x20—\x20src/api\x20경유','why':'Next.js\x20App\x20Router\x20기본\x20템플릿','source':a},{'id':'tpl-next-http-client-in-api','target':{},'rule':{'type':'placement','role':'http-client','glob':b},'severity':'warning','enforce':'inform','origin':'proposed','message':'HTTP\x20클라이언트(axios.create\x20등)는\x20src/api\x20안에\x20둔다','why':'Next.js\x20App\x20Router\x20기본\x20템플릿','source':a},{'id':'tpl-next-unique-http-client','target':{},'rule':{'type':'unique-role','role':'http-client','max':0x1},'severity':'warning','enforce':'inform','origin':'proposed','message':'같은\x20백엔드·같은\x20인증의\x20HTTP\x20클라이언트는\x20하나만\x20둔다\x20—\x20기존\x20클라이언트를\x20import','why':'Next.js\x20App\x20Router\x20기본\x20템플릿','source':a},{'id':'tpl-next-hook-not-component','target':{'layer':'hook'},'rule':{'type':'forbid-dependency','to':{'layer':'component'}},'severity':'warning','enforce':'inform','origin':'proposed','message':'훅은\x20컴포넌트에\x20의존하지\x20않는다','why':'Next.js\x20App\x20Router\x20기본\x20템플릿','source':a}];}export function templatesFor(a){const b=[];if(a['includes']('express'))b['push'](...expressTemplate());if(a['includes']('next'))b['push'](...nextTemplate());return b['sort']((c,d)=>c['id']['localeCompare'](d['id']));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import*as a43a from'fs';import*as a43b from'path';import{homedir}from'os';export function knowledgeDir(){return process.env.ROUTINECODE_KNOWLEDGE_DIR||a43b['join'](process.env.ROUTINECODE_DIR||a43b['join'](homedir(),'.routinecode'),'knowledge');}export function knowledgePath(a){return a43b['join'](knowledgeDir(),a);}export const FILES={'EVENTS':'events.jsonl','PATTERNS':'patterns.jsonl','QUIRKS':'quirks.jsonl','DOMAIN_KNOWLEDGE':'domain-knowledge.jsonl','DECISIONS':'decisions.jsonl','CONCEPTS':'concepts.jsonl','DENOTES':'denotes.jsonl','ASSERTIONS':'assertions.jsonl'};export const SOURCE={'ERROR_FIX':'error-fix','PATTERN':'pattern','QUIRK':'quirk','DOMAIN_KNOWLEDGE':'domain-knowledge'};const s=a=>String(a??'');export function errorFixSourceId(a,b,c){return'ef:'+(s(a)||'unknown')+':'+(s(b)||s(c));}export function patternSourceId(a,b){return'pt:'+s(a)+':'+s(b);}export function quirkSourceId(a,b){return'qk:'+s(a)+':'+s(b);}export function domainKnowledgeSourceId(a,b){return'dk:'+s(a)+':'+s(b);}export function readJsonl(a){try{if(!a43a['existsSync'](a))return[];return a43a['readFileSync'](a,'utf-8')['trim']()['split']('\x0a')['filter'](Boolean)['map'](b=>{try{return JSON['parse'](b);}catch{return null;}})['filter'](b=>b!==null);}catch{return[];}}export function readDenotes(){return readJsonl(knowledgePath(FILES['DENOTES']));}export function readDomainKnowledge(){return readJsonl(knowledgePath(FILES['DOMAIN_KNOWLEDGE']));}export function relatedSourceIds(a,b,c,d){return new Set(a['filter'](e=>b['has'](e['conceptId'])&&e['sourceType']===c&&e['sourceId']&&!d['has'](e['sourceId']))['map'](e=>e['sourceId']));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a47_0xd7d577=a47_0xcaab;function a47_0x4ebe(){const _0x76491a=['fv7cPv9xW7nub10caG','FSkpW5PrvCkIeSomiCo5','pSkNAv8Gkq','uu3cTWu','W6ddILBcHCoDa8oZsq','sXfCW6RdOmoNWRFcQtK','W6VdIKa','h0yaW5hdLCo3WRlcPIG','W73cMX8QW44','W67cJmkOuq3dH8o+cW','AW9qrh0glW','ue/dPG','nmo7aq','amk1W5LpWO97W7Lx','WPGBa1PXkG','pvSsf8ol','mYlcIJO','W6HVlfS','n0iaecLZh0/dSHRcK0q','CmkZbmkW','W4azF8oYcmkU','lIdcNSo1aSkpimkX','CNZdKte','W4NdIbSrqNlcI0S','W6ddHIZcQ8oxm8oFAmoW','WPekW5b/nCor','iZddPrDBW4vthGGdW7OX','WQ/dRuv4','WOVdQ0ZcKa','WPJdNCoe','iK4qgColW6G','W4uEeM/dTv91WRpdLmks','W7BcMMFcUcTZ','W6i0W57dK8k5WPiaWR4','n8k6yLS','WO4IeSosySkI','Cmk6hq','aepcQfLgW44','WRhdRW4n','W65Lk1lcGmk8','geRdPW','esxcTZToi8oXsHOMWPddNLK','WOJdL8obW5jQ','WPNdI8kPWRK','rgLwESo0','W7ZcLMxcQZPP','pCkXgSkGta','hMzwyq','EMNcPq','W73cPCkafSkqW4C','W7NdNhZdNqpdRq','fL/cT0u','W6dcRehdQ3no','lIpdQ8kzASo+smk4t8olEWGS','W5yfymoU','W5VdJCkTWQ3dMCkz','WRRdKSkkFYxdNW','WORdKmkQ','la7cItbea8kwW5dcS8ovkSoYWOC','umopWRBdMG','WQXTl0y','W7bHmvZcMW','WP/dKmk/WRa5FX5uCSoKW5mh','mZNcIti','W4SNqCkycSoyDJtcVa','WO0oW4XRja','W6VcGaXPWOi','DqXqxxSJ','WPD4emoIwCokzb7cItVcSW','ohJdIdy','deddPCo+t8opWPe','A8oZmG1HnCoYW50mECoT','ECkjW5jo','W4WdfxVdTuq','WO7dMSkWWQ89Bb9FvCoYW48','detdU8o1s8oF','k8kKcmoUha','pL4nfG','mmo2fmkrWR7dKbtcJ3hdLG','W4Kpsqe','W6dcQe7dQfbuD8o4nCoqW7GA','tbldM8oiy8ogWQXo','ggjlCSo/wq','A8omW6lcM0aA','WOVcIKTukdldL2rVWQFdMSkaW5a','W7bLnvNcLCk3iq','C3dcSSoil8kH','xb5wW4ldO8oY','W4OzFCoJ','WP7dGmkUWRK7','W7VcM20','W4pdMSkQWQC','WP/dKmk6WQKQEW','WPhdQ0G','eMaCnmkZW5y','DmogW6hcMq','n8kSy3CYj8oGW7C5','m8oCWRlcV0hcGxC','W67dML3dKSkf','WO3cI0Txjd3dLwLpWQxdUCkuW7i','u8ooWQtdGmoIimkfWOO/hSoD','EhdcQa','qe/cPqtcRa','nmk3AvSGkmo8W7W+','WQ/dLmklBG','WPfqsI3cUbuuWOBdV8kIWR/dIIC','iCo7fmkhWRVdLHZcJ2pdMYbH','WRNdSvP1','bMzlCSoUqG','WRRdQeb+WPC','W67cNe7dHW','WRZcNMq','W4xdJCkIWQ7dQ8kyymomW5dcMmoSW6e','mSonWRxcTvdcPa','eulcRufg','bxzr','qHzA','WP/dLmkWWRSSBq','WRv3WOFcHSo8W4XDWPiYxCksW4xdNW','WO0AW41W','WQhcIMFcTW','dgPjCa','W6/dJJhdSCkMba','W5icESoR','W6lcRmkheSkb','z3JdLM7cSxxdKmklk3ZcRSo7W5u','W4tdNmkIWRJdMCk+ASopW7dcHmo2','W7FcSSkbha','kwxdNw/cOW','WOBcKCo6W7pcNmojt8onW5BcS8oVW4y','WQtcJxG','W7dcOK5uoqmOWQhcVc4CW7S','W5ZdLryakYtdIG','dhzlDSoUqY4SW7O','FM3cUeeEWPq','C8oBW6xcKwCga2NdJa','W4OvFCoHgCk0','W6JdGsBdTmkLbrJcIG','WO3dQ17cGd3dUKTzW6zgW5y','W77cQehdQ2jv','th3dR2C','W7JcGqqNW47cK8oeka','W63dKgtdNbtdSq','f0VdTSo+w8oiWPfe','WOCBgq','W6LxoCoXjLTMhdlcJSoyW7m','cLFdVmo/FCoyWPvfEW','fv7cPvLWW4vCaG','W7ZcIMFcVcTYWQTxBCojB8oG','W7COW4RdLq','xCk3Bmk0pKWsW7KNWRS','WOhdKmkWWRS9DG','WPSUdG','vmoFWRBdHG','W7yKW5ZdKCk5WPizWRu'];a47_0x4ebe=function(){return _0x76491a;};return a47_0x4ebe();}(function(_0x57a8b4,_0x535dae){const _0x1961c3=a47_0xcaab,_0x2321bd=_0x57a8b4();while(!![]){try{const _0x1d882a=parseInt(_0x1961c3(0x183,'cmD2'))/(0xa*-0xe5+-0x34e+0xc41)+parseInt(_0x1961c3(0x17b,'HkF['))/(0x1241+-0xe34+-0x9*0x73)*(parseInt(_0x1961c3(0x17e,'[GIA'))/(0x122+0x208a+-0x1*0x21a9))+parseInt(_0x1961c3(0x19e,'[GIA'))/(-0x53*-0x20+0x1467+-0x1ec3)+parseInt(_0x1961c3(0x1ad,')CI4'))/(-0x1*-0x823+0x285+-0xaa3)*(-parseInt(_0x1961c3(0x170,'V^6)'))/(-0x2336+-0x2414+0x4750))+-parseInt(_0x1961c3(0x1a3,'DbvN'))/(-0xb3*-0x2b+0x7f1*0x4+-0x3dce)+parseInt(_0x1961c3(0x1d2,'6As%'))/(-0x25*-0x3d+0x1*0x24b1+-0x2d7a)*(-parseInt(_0x1961c3(0x172,'$K8H'))/(-0xee3*0x2+0x3*0x5f3+-0x1*-0xbf6))+parseInt(_0x1961c3(0x192,'Hnrc'))/(0x1*-0x869+0x1b24+0x13f*-0xf);if(_0x1d882a===_0x535dae)break;else _0x2321bd['push'](_0x2321bd['shift']());}catch(_0x5d4a43){_0x2321bd['push'](_0x2321bd['shift']());}}}(a47_0x4ebe,0x85fe6+-0x8dddb+0x59ce6));import*as a47_0x4551d7 from'fs';import*as a47_0x3bdadf from'path';import{fileURLToPath}from'url';import{changedLines,packageRoot,JS_FAMILY_RE,TEST_FILE_RE}from'./changeset.js';function real(_0x47cec2){const _0x375cb7=a47_0xcaab;try{return a47_0x4551d7[_0x375cb7(0x1a7,'gIAZ')][_0x375cb7(0x148,'d16R')](_0x47cec2);}catch{return _0x47cec2;}}function a47_0xcaab(_0x539cfb,_0x2978e1){_0x539cfb=_0x539cfb-(-0x6b1*0x4+0xa*-0x3cb+-0x20fb*-0x2);const _0x58a8b9=a47_0x4ebe();let _0x7344f7=_0x58a8b9[_0x539cfb];if(a47_0xcaab['PcNmxR']===undefined){var _0x3286aa=function(_0x371223){const _0x3310eb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x34bbd4='',_0x5db7d1='';for(let _0x44697e=0x2*0xa87+-0x1*0x49d+-0x17*0xb7,_0x9b492e,_0x169b2b,_0x2a0716=-0x1*-0xa31+0xaf3+0xf6*-0x16;_0x169b2b=_0x371223['charAt'](_0x2a0716++);~_0x169b2b&&(_0x9b492e=_0x44697e%(-0x115*-0x17+-0x175b+-0x184)?_0x9b492e*(0x19a2+0x7a*-0x42+0x612)+_0x169b2b:_0x169b2b,_0x44697e++%(0x65+0x1aa9+-0x1b0a))?_0x34bbd4+=String['fromCharCode'](-0x1bb5+0xa7*0x5+0x1971&_0x9b492e>>(-(-0x50*-0x61+0x2*-0x8c3+-0x2*0x664)*_0x44697e&0x66e+-0x895+-0x22d*-0x1)):0x9a4*0x2+-0x1f2d+-0x261*-0x5){_0x169b2b=_0x3310eb['indexOf'](_0x169b2b);}for(let _0x46921b=0x765+0x2bf+-0xa24,_0x360a91=_0x34bbd4['length'];_0x46921b<_0x360a91;_0x46921b++){_0x5db7d1+='%'+('00'+_0x34bbd4['charCodeAt'](_0x46921b)['toString'](0x1c1b+0x181a+-0x3425))['slice'](-(-0x1508+-0x56*-0x23+0x948));}return decodeURIComponent(_0x5db7d1);};const _0x409c=function(_0x320a58,_0x419bb3){let _0x170e34=[],_0x528424=0x375+0x3*-0x1fb+0x27c,_0x593c6f,_0x29ef06='';_0x320a58=_0x3286aa(_0x320a58);let _0xfaf393;for(_0xfaf393=0xaa8+-0x2a2*0xd+-0xe*-0x1af;_0xfaf393<-0x184*0xa+-0x28a*-0xa+-0x93c;_0xfaf393++){_0x170e34[_0xfaf393]=_0xfaf393;}for(_0xfaf393=-0x5fb+-0x846+0xe41;_0xfaf393<-0x5bf*0x3+0x1*-0x1af0+0x2d2d;_0xfaf393++){_0x528424=(_0x528424+_0x170e34[_0xfaf393]+_0x419bb3['charCodeAt'](_0xfaf393%_0x419bb3['length']))%(-0x6c*0x55+0xd2d*-0x1+0x3209),_0x593c6f=_0x170e34[_0xfaf393],_0x170e34[_0xfaf393]=_0x170e34[_0x528424],_0x170e34[_0x528424]=_0x593c6f;}_0xfaf393=-0x5*-0x4bd+-0x1462+-0x34f,_0x528424=-0x139e+0x1a34+-0x34b*0x2;for(let _0x261dea=-0xd8c+-0x1*-0x47b+-0xb*-0xd3;_0x261dea<_0x320a58['length'];_0x261dea++){_0xfaf393=(_0xfaf393+(-0x1*0x5c5+-0x1aac+0x2072))%(-0x2199+0x13*0xd3+0x12f0),_0x528424=(_0x528424+_0x170e34[_0xfaf393])%(0x5*0x78+0xb01+-0xc59),_0x593c6f=_0x170e34[_0xfaf393],_0x170e34[_0xfaf393]=_0x170e34[_0x528424],_0x170e34[_0x528424]=_0x593c6f,_0x29ef06+=String['fromCharCode'](_0x320a58['charCodeAt'](_0x261dea)^_0x170e34[(_0x170e34[_0xfaf393]+_0x170e34[_0x528424])%(0x1393+0x1796+-0x2a29)]);}return _0x29ef06;};a47_0xcaab['HGPCeo']=_0x409c,a47_0xcaab['HnXIBP']={},a47_0xcaab['PcNmxR']=!![];}const _0x5e0a59=_0x58a8b9[0x5*-0xb5+0x1a74+-0x16eb*0x1],_0x358bc4=_0x539cfb+_0x5e0a59,_0x10463b=a47_0xcaab['HnXIBP'][_0x358bc4];return!_0x10463b?(a47_0xcaab['FhEOZG']===undefined&&(a47_0xcaab['FhEOZG']=!![]),_0x7344f7=a47_0xcaab['HGPCeo'](_0x7344f7,_0x2978e1),a47_0xcaab['HnXIBP'][_0x358bc4]=_0x7344f7):_0x7344f7=_0x10463b,_0x7344f7;}function urlToPath(_0x4faac4){const _0x5dc261=a47_0xcaab;if(!_0x4faac4)return null;let _0x1ddf68=null;if(_0x4faac4[_0x5dc261(0x16a,'wG*)')](_0x5dc261(0x152,'u$fk')))try{_0x1ddf68=fileURLToPath(_0x4faac4);}catch{return null;}else a47_0x3bdadf[_0x5dc261(0x164,'ES2^')](_0x4faac4)&&(_0x1ddf68=_0x4faac4);return _0x1ddf68?real(_0x1ddf68):null;}export function loadV8Coverage(_0x173353){const _0x2f7a8a=a47_0xcaab,_0x2ce3a8=new Map();let _0x3284e3=[];try{_0x3284e3=a47_0x4551d7[_0x2f7a8a(0x158,'e!Z2')](_0x173353)[_0x2f7a8a(0x1a1,'$K8H')](_0x4b4fff=>_0x4b4fff[_0x2f7a8a(0x176,'%(DU')](_0x2f7a8a(0x195,'j12M')));}catch{return _0x2ce3a8;}for(const _0x475caa of _0x3284e3){let _0x264e06;try{_0x264e06=JSON[_0x2f7a8a(0x1aa,'1qQu')](a47_0x4551d7[_0x2f7a8a(0x1d3,'5jl]')](a47_0x3bdadf[_0x2f7a8a(0x15a,'Hnrc')](_0x173353,_0x475caa),_0x2f7a8a(0x1b5,'VfaT')));}catch{continue;}for(const _0x54d598 of _0x264e06[_0x2f7a8a(0x1c7,'U9FY')]??[]){const _0x25a34f=urlToPath(_0x54d598[_0x2f7a8a(0x150,'3oqn')]);if(!_0x25a34f||_0x25a34f[_0x2f7a8a(0x157,'d16R')](a47_0x3bdadf[_0x2f7a8a(0x186,'#nmk')]+_0x2f7a8a(0x15f,'Bv#8')+a47_0x3bdadf[_0x2f7a8a(0x166,'8]r$')]))continue;const _0x16a675=_0x2ce3a8[_0x2f7a8a(0x16f,'SZxz')](_0x25a34f);if(_0x16a675)_0x16a675[_0x2f7a8a(0x19f,'C%TW')](..._0x54d598[_0x2f7a8a(0x1d0,'jaXj')]);else _0x2ce3a8[_0x2f7a8a(0x15e,'0I[J')](_0x25a34f,[..._0x54d598[_0x2f7a8a(0x153,'j12M')]]);}}return _0x2ce3a8;}function lineStarts(_0x1537de){const _0x57f018=a47_0xcaab,_0x30bedd=[-0x3*-0x907+-0xd*-0x2d+0x7*-0x432];for(let _0x4d92ec=0x8f0+0xdab*-0x1+-0xad*-0x7;_0x4d92ec<_0x1537de[_0x57f018(0x190,'iNPq')];_0x4d92ec++)if(_0x1537de[_0x57f018(0x1b7,'5jl]')](_0x4d92ec)===0x1718+-0x1744+-0x1b*-0x2)_0x30bedd[_0x57f018(0x18f,'gwMq')](_0x4d92ec+(-0xa*0x2e4+0xa3*0x2b+0x188));return _0x30bedd;}function countAt(_0x569344,_0x264d0a){const _0x8d1276=a47_0xcaab;let _0x5c1ba9=null;for(const _0x2db6d9 of _0x569344){for(const _0x43b29d of _0x2db6d9[_0x8d1276(0x1de,'gIAZ')]){if(_0x43b29d[_0x8d1276(0x14c,'C49m')]<=_0x264d0a&&_0x264d0a<_0x43b29d[_0x8d1276(0x1c9,'jaXj')]){if(!_0x5c1ba9||_0x43b29d[_0x8d1276(0x16e,'V^6)')]-_0x43b29d[_0x8d1276(0x169,'ie1p')]<_0x5c1ba9[_0x8d1276(0x1a9,')CI4')]-_0x5c1ba9[_0x8d1276(0x1cd,'[^^p')])_0x5c1ba9=_0x43b29d;}}}return _0x5c1ba9?_0x5c1ba9[_0x8d1276(0x193,'#nmk')]:null;}function anyExecuted(_0x232a2a){const _0x21b050=a47_0xcaab;return!!_0x232a2a&&_0x232a2a[_0x21b050(0x1d1,'$K8H')](_0x1549b1=>_0x1549b1[_0x21b050(0x1b4,'B85N')][_0x21b050(0x1bc,'QHak')]>-0x7d6+-0x37*0x5f+0x409*0x7&&_0x1549b1[_0x21b050(0x19d,'Qe1N')][-0x13c6+-0x50*-0x61+0x26*-0x47][_0x21b050(0x171,'YXfx')]>-0x6*-0x143+-0x899+0x107);}function counterpartCandidates(_0x580699){const _0x2e4a20=a47_0xcaab,_0x112ffc=real(_0x580699),_0x3010d3=packageRoot(_0x112ffc),_0x9fa7a9=_0x112ffc[_0x2e4a20(0x1be,'iNPq')](/\.[^.]+$/,''),_0x555eff=[_0x9fa7a9+_0x2e4a20(0x18d,'VfaT'),_0x9fa7a9+_0x2e4a20(0x1a5,'iNPq'),_0x9fa7a9+_0x2e4a20(0x194,'C49m')];if(_0x3010d3){const _0x4bdc7b=a47_0x3bdadf[_0x2e4a20(0x168,'Wuh9')](_0x3010d3,_0x9fa7a9),_0xd766da=_0x4bdc7b[_0x2e4a20(0x1af,'B85N')](/^(src|lib)[\\/]/,'');for(const _0x4efc19 of[_0x2e4a20(0x1ae,')t$6'),_0x2e4a20(0x1cb,'SZxz'),_0x2e4a20(0x1dd,'V^6)'),_0x2e4a20(0x1dc,'j12M')]){for(const _0x4ae98e of[_0x2e4a20(0x174,'B85N'),_0x2e4a20(0x17f,')t$6'),_0x2e4a20(0x17c,'VfaT')]){_0x555eff[_0x2e4a20(0x146,'3oqn')](a47_0x3bdadf[_0x2e4a20(0x17a,'iNPq')](_0x3010d3,_0x4efc19,_0xd766da+_0x4ae98e),a47_0x3bdadf[_0x2e4a20(0x1d7,'r)ns')](_0x3010d3,_0x4efc19,_0x4bdc7b+_0x4ae98e));}}}return Array[_0x2e4a20(0x14d,'m[Vj')](new Set(_0x555eff[_0x2e4a20(0x1d8,'3oqn')](real)));}function counterpartFunctions(_0x4eefc7,_0x155093){const _0x3fbe19=a47_0xcaab,_0x2e6e42=[..._0x155093[_0x3fbe19(0x175,'5jl]')](real(_0x4eefc7))??[]];let _0x3ecccc=![],_0x42069a=-0x619*-0x4+0x2c0*-0x9+0x5c;try{_0x42069a=a47_0x4551d7[_0x3fbe19(0x161,'ie1p')](_0x4eefc7)[_0x3fbe19(0x1ca,'YoB9')];}catch{}for(const _0x2ea7cf of counterpartCandidates(_0x4eefc7)){if(_0x2ea7cf===real(_0x4eefc7))continue;const _0x89414a=_0x155093[_0x3fbe19(0x1ce,'[GIA')](_0x2ea7cf);if(!_0x89414a)continue;_0x2e6e42[_0x3fbe19(0x1b6,'RB]D')](..._0x89414a);try{if(a47_0x4551d7[_0x3fbe19(0x180,'u$fk')](_0x2ea7cf)[_0x3fbe19(0x173,'HkF[')]+(0x1*0x26cb+-0x1fbe+-0x325)<_0x42069a)_0x3ecccc=!![];}catch{}}return{'fns':_0x2e6e42,'stale':_0x3ecccc};}const NOT_NAMES=new Set(['if',a47_0xd7d577(0x191,'B85N'),a47_0xd7d577(0x1db,'ie1p'),a47_0xd7d577(0x1ac,'HkF['),a47_0xd7d577(0x197,'VfaT'),a47_0xd7d577(0x19b,'XA&Q'),a47_0xd7d577(0x18a,'Wuh9'),a47_0xd7d577(0x1b3,'gIAZ'),a47_0xd7d577(0x1c2,'gIAZ'),a47_0xd7d577(0x1c6,'e!Z2'),a47_0xd7d577(0x1cf,'Pj1n')]),DECL_RES=[/\bfunction\s*\*?\s*([A-Za-z_$][\w$]*)\s*[<(]/,/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s+)?function\b/,/\b([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::\s*[^=]+)?=>/,/^\s*(?:(?:public|private|protected|static|async|override|readonly)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\([^)]*\)\s*(?::\s*[^{]+)?\{\s*$/];export function enclosingFunctionNames(_0x417b5f,_0x104429){const _0xc03f4d=a47_0xd7d577,_0x2c4144=_0x417b5f[_0xc03f4d(0x178,'RB]D')]('\x0a'),_0xb0dee3=new Set();let _0x4ea7cb=![];const _0x5f14de=_0xe70e59=>_0xe70e59[_0xc03f4d(0x156,'C%TW')]-_0xe70e59[_0xc03f4d(0x160,'B85N')]()[_0xc03f4d(0x187,'RB]D')];for(const _0x355b14 of _0x104429){const _0x505067=_0x2c4144[_0x355b14-(-0x51*0x35+0x1c1b+-0xb55)];if(_0x505067===undefined||!_0x505067[_0xc03f4d(0x1b1,'wG*)')]())continue;let _0x12caa5=null;const _0x17320b=_0x5f14de(_0x505067);for(let _0x526658=_0x355b14-(-0x1508+-0x56*-0x23+0x947);_0x526658>=0x375+0x3*-0x1fb+0x27c;_0x526658--){const _0x4cd43a=_0x2c4144[_0x526658];if(!_0x4cd43a[_0xc03f4d(0x149,'C%TW')]())continue;if(_0x526658<_0x355b14-(0xaa8+-0x2a2*0xd+-0x47*-0x55)&&_0x5f14de(_0x4cd43a)>=_0x17320b)continue;for(const _0x2d8c13 of DECL_RES){const _0x3c10c7=_0x2d8c13[_0xc03f4d(0x18b,'jaXj')](_0x4cd43a);if(_0x3c10c7&&!NOT_NAMES[_0xc03f4d(0x199,'cmD2')](_0x3c10c7[-0x184*0xa+-0x28a*-0xa+-0xa3b])){_0x12caa5=_0x3c10c7[-0x5fb+-0x846+0xe42];break;}}if(_0x12caa5||_0x5f14de(_0x4cd43a)===-0x5bf*0x3+0x1*-0x1af0+0x2c2d)break;}if(_0x12caa5)_0xb0dee3[_0xc03f4d(0x1c3,'7Zhu')](_0x12caa5);else _0x4ea7cb=!![];}return{'names':Array[_0xc03f4d(0x1a8,'(zRf')](_0xb0dee3),'topLevel':_0x4ea7cb};}export function computeDiffCoverage(_0x1727a6,_0x2295ec){const _0x35ddf3=a47_0xd7d577,_0x47e0cf=_0x1727a6[_0x35ddf3(0x18e,'ie1p')](_0xe8ea35=>JS_FAMILY_RE[_0x35ddf3(0x198,'j12M')](_0xe8ea35)&&!TEST_FILE_RE[_0x35ddf3(0x1b8,'Of8N')](_0xe8ea35)&&a47_0x4551d7[_0x35ddf3(0x188,'6As%')](_0xe8ea35));if(_0x47e0cf[_0x35ddf3(0x16b,'jaXj')]===-0x6c*0x55+0xd2d*-0x1+0x3109)return{'measured':![],'ratio':null,'files':[]};const _0x75c2e0=loadV8Coverage(_0x2295ec);if(_0x75c2e0[_0x35ddf3(0x163,'Wuh9')]===-0x5*-0x4bd+-0x1462+-0x34f)return{'measured':![],'ratio':null,'files':[]};const _0x45eaf6=[];for(const _0x2d21a9 of _0x47e0cf){const _0x145749=_0x75c2e0[_0x35ddf3(0x1a2,'gIAZ')](real(_0x2d21a9));if(/\.(c|m)?jsx?$/[_0x35ddf3(0x167,'[^^p')](_0x2d21a9)&&_0x145749){const _0x4f4309=a47_0x4551d7[_0x35ddf3(0x1b9,'Qe1N')](_0x2d21a9,_0x35ddf3(0x1ab,'YXfx')),_0xd9b147=lineStarts(_0x4f4309),_0xbed623=(changedLines(_0x2d21a9)??[])[_0x35ddf3(0x15c,'XA&Q')](_0x14d085=>_0x14d085>=-0x139e+0x1a34+-0x695*0x1&&_0x14d085<=_0xd9b147[_0x35ddf3(0x165,'gIAZ')]),_0x17efdc=_0xbed623[_0x35ddf3(0x17d,'C%TW')](_0x136080=>{const _0x25cdc3=_0x35ddf3,_0x454f69=_0x4f4309[_0x25cdc3(0x1d6,'uGUY')](_0xd9b147[_0x136080-(-0xd8c+-0x1*-0x47b+-0x9*-0x102)],_0xd9b147[_0x136080]??_0x4f4309[_0x25cdc3(0x165,'gIAZ')])[_0x25cdc3(0x1c4,'C49m')]();return _0x454f69[_0x25cdc3(0x1a0,'C49m')]>-0x1*0x5c5+-0x1aac+0x2071&&!/^(\/\/|\/\*|\*|[})\];,]+$)/[_0x25cdc3(0x185,'e!Z2')](_0x454f69);});if(_0x17efdc[_0x35ddf3(0x154,'cmD2')]===-0x2199+0x13*0xd3+0x11f0){const _0x18f1ae=anyExecuted(_0x145749);_0x45eaf6[_0x35ddf3(0x19c,'ie1p')]({'file':_0x2d21a9,'mode':_0x35ddf3(0x184,'uGUY'),'exercised':_0x18f1ae,'ratio':_0x18f1ae?0x5*0x78+0xb01+-0xd58:0x1393+0x1796+-0x2b29});continue;}let _0x2727fd=0x5*-0xb5+0x1a74+-0x16eb*0x1;for(const _0x181ae9 of _0x17efdc){const _0x2d44f5=_0xd9b147[_0x181ae9-(-0x5e3*-0x5+0x518*-0x1+-0x1bd*0xe)],_0x228174=_0x4f4309[_0x35ddf3(0x14a,'m[Vj')](_0x2d44f5,_0xd9b147[_0x181ae9]??_0x4f4309[_0x35ddf3(0x177,'0I[J')]),_0x48e6d9=_0x2d44f5+(_0x228174[_0x35ddf3(0x1d5,'j12M')]-_0x228174[_0x35ddf3(0x155,'QHak')]()[_0x35ddf3(0x189,'7Zhu')]),_0x4e0d12=countAt(_0x145749,_0x48e6d9);if(_0x4e0d12!==null&&_0x4e0d12>0x3*-0xd05+0x12*0x56+0x2103)_0x2727fd++;}_0x45eaf6[_0x35ddf3(0x1d4,'uGUY')]({'file':_0x2d21a9,'mode':_0x35ddf3(0x1c1,'C%TW'),'exercised':_0x2727fd>0x1*-0x148d+0x1*-0x4a3+0x1930,'lines':[_0x2727fd,_0x17efdc[_0x35ddf3(0x182,'1qQu')]],'ratio':_0x2727fd/_0x17efdc[_0x35ddf3(0x1bf,'[GIA')]});}else{const {fns:_0x3aa35e,stale:_0x530751}=counterpartFunctions(_0x2d21a9,_0x75c2e0);if(_0x530751){_0x45eaf6[_0x35ddf3(0x1a4,'[^^p')]({'file':_0x2d21a9,'mode':_0x35ddf3(0x179,'(zRf'),'exercised':![],'ratio':0x0,'stale':!![]});continue;}const _0x3649d0=a47_0x4551d7[_0x35ddf3(0x1d9,'C49m')](_0x2d21a9,_0x35ddf3(0x14e,')t$6')),{names:_0x42bc9a}=enclosingFunctionNames(_0x3649d0,changedLines(_0x2d21a9)??[]);if(_0x42bc9a[_0x35ddf3(0x159,'Qe1N')]===0x1c89+-0x2281+0x5f8){const _0x357feb=anyExecuted(_0x3aa35e);_0x45eaf6[_0x35ddf3(0x145,'1qQu')]({'file':_0x2d21a9,'mode':_0x35ddf3(0x147,'j12M'),'exercised':_0x357feb,'ratio':_0x357feb?0x1fff+-0x1efb+0x103*-0x1:0x31d*-0x3+0x20*-0x8+-0xa57*-0x1});continue;}const _0x4f0cb9=_0x42bc9a[_0x35ddf3(0x196,'7Zhu')](_0x322c6e=>_0x3aa35e[_0x35ddf3(0x1c8,'QHak')](_0x3249ab=>_0x3249ab[_0x35ddf3(0x162,'7Zhu')]===_0x322c6e&&_0x3249ab[_0x35ddf3(0x1c0,'V^6)')][_0x35ddf3(0x189,'7Zhu')]>0x303+-0xe*0x5f+0x22f&&_0x3249ab[_0x35ddf3(0x1bb,'j12M')][0xcec*-0x1+-0x1ce9*-0x1+-0xffd*0x1][_0x35ddf3(0x193,'#nmk')]>-0xcad+0xa0+0xc0d)),_0x2220dc=_0x42bc9a[_0x35ddf3(0x18c,'8]r$')](_0x49ed2d=>!_0x4f0cb9[_0x35ddf3(0x15d,'B85N')](_0x49ed2d));_0x45eaf6[_0x35ddf3(0x16c,'Pj1n')]({'file':_0x2d21a9,'mode':_0x35ddf3(0x15b,'YXfx'),'exercised':_0x4f0cb9[_0x35ddf3(0x19a,'m[Vj')]>0x11e7+-0x60d*0x3+-0x10*-0x4,'functions':{'executed':_0x4f0cb9,'missed':_0x2220dc},'ratio':_0x4f0cb9[_0x35ddf3(0x1da,'YoB9')]/_0x42bc9a[_0x35ddf3(0x1b2,'6As%')]});}}const _0x1be669=_0x45eaf6[_0x35ddf3(0x1c5,'gIAZ')]((_0x4d1f1d,_0x1d2491)=>_0x4d1f1d+_0x1d2491[_0x35ddf3(0x1a6,'iNPq')],0x11*0x1db+0x17a+0x4f*-0x6b)/_0x45eaf6[_0x35ddf3(0x159,'Qe1N')];return{'measured':!![],'ratio':_0x1be669,'files':_0x45eaf6};}
|
|
1
|
+
import*as a44a from'fs';import*as a44b from'path';import{fileURLToPath}from'url';import{changedLines,packageRoot,JS_FAMILY_RE,TEST_FILE_RE}from'./changeset.js';import{lineStarts}from'./config-map/blocks.js';function real(a){try{return a44a['realpathSync']['native'](a);}catch{return a;}}function urlToPath(a){if(!a)return null;let b=null;if(a['startsWith']('file://'))try{b=fileURLToPath(a);}catch{return null;}else a44b['isAbsolute'](a)&&(b=a);return b?real(b):null;}export function loadV8Coverage(a){const b=new Map();let c=[];try{c=a44a['readdirSync'](a)['filter'](d=>d['endsWith']('.json'));}catch{return b;}for(const d of c){let e;try{e=JSON['parse'](a44a['readFileSync'](a44b['join'](a,d),'utf-8'));}catch{continue;}for(const g of e['result']??[]){const h=urlToPath(g['url']);if(!h||h['includes'](a44b['sep']+'node_modules'+a44b['sep']))continue;const i=b['get'](h);if(i)i['push'](...g['functions']);else b['set'](h,[...g['functions']]);}}return b;}function countAt(a,b){let c=null;for(const d of a){for(const e of d['ranges']){if(e['startOffset']<=b&&b<e['endOffset']){if(!c||e['endOffset']-e['startOffset']<c['endOffset']-c['startOffset'])c=e;}}}return c?c['count']:null;}function anyExecuted(a){return!!a&&a['some'](b=>b['ranges']['length']>0x0&&b['ranges'][0x0]['count']>0x0);}function counterpartCandidates(a){const b=real(a),c=packageRoot(b),d=b['replace'](/\.[^.]+$/,''),e=[d+'.js',d+'.mjs',d+'.cjs'];if(c){const f=a44b['relative'](c,d),g=f['replace'](/^(src|lib)[\\/]/,'');for(const h of['dist','build','lib','out']){for(const i of['.js','.mjs','.cjs']){e['push'](a44b['join'](c,h,g+i),a44b['join'](c,h,f+i));}}}return Array['from'](new Set(e['map'](real)));}function counterpartFunctions(a,b){const d=[...b['get'](real(a))??[]];let e=![],f=0x0;try{f=a44a['statSync'](a)['mtimeMs'];}catch{}for(const g of counterpartCandidates(a)){if(g===real(a))continue;const h=b['get'](g);if(!h)continue;d['push'](...h);try{if(a44a['statSync'](g)['mtimeMs']+0x3e8<f)e=!![];}catch{}}return{'fns':d,'stale':e};}const NOT_NAMES=new Set(['if','for','while','switch','catch','return','function','constructor','super','new','await']),DECL_RES=[/\bfunction\s*\*?\s*([A-Za-z_$][\w$]*)\s*[<(]/,/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s+)?function\b/,/\b([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::\s*[^=]+)?=>/,/^\s*(?:(?:public|private|protected|static|async|override|readonly)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\([^)]*\)\s*(?::\s*[^{]+)?\{\s*$/];export function enclosingFunctionNames(a,b){const c=a['split']('\x0a'),d=new Set();let e=![];const f=g=>g['length']-g['trimStart']()['length'];for(const g of b){const h=c[g-0x1];if(h===undefined||!h['trim']())continue;let j=null;const k=f(h);for(let l=g-0x1;l>=0x0;l--){const o=c[l];if(!o['trim']())continue;if(l<g-0x1&&f(o)>=k)continue;for(const p of DECL_RES){const q=p['exec'](o);if(q&&!NOT_NAMES['has'](q[0x1])){j=q[0x1];break;}}if(j||f(o)===0x0)break;}if(j)d['add'](j);else e=!![];}return{'names':Array['from'](d),'topLevel':e};}export function computeDiffCoverage(a,b){const d=a['filter'](i=>JS_FAMILY_RE['test'](i)&&!TEST_FILE_RE['test'](i)&&a44a['existsSync'](i));if(d['length']===0x0)return{'measured':![],'ratio':null,'files':[]};const e=loadV8Coverage(b);if(e['size']===0x0)return{'measured':![],'ratio':null,'files':[]};const g=[];for(const i of d){const j=e['get'](real(i));if(/\.(c|m)?jsx?$/['test'](i)&&j){const k=a44a['readFileSync'](i,'utf-8'),l=lineStarts(k),m=(changedLines(i)??[])['filter'](q=>q>=0x1&&q<=l['length']),o=m['filter'](q=>{const r=k['slice'](l[q-0x1],l[q]??k['length'])['trim']();return r['length']>0x0&&!/^(\/\/|\/\*|\*|[})\];,]+$)/['test'](r);});if(o['length']===0x0){const q=anyExecuted(j);g['push']({'file':i,'mode':'file','exercised':q,'ratio':q?0x1:0x0});continue;}let p=0x0;for(const r of o){const s=l[r-0x1],t=k['slice'](s,l[r]??k['length']),u=s+(t['length']-t['trimStart']()['length']),v=countAt(j,u);if(v!==null&&v>0x0)p++;}g['push']({'file':i,'mode':'line','exercised':p>0x0,'lines':[p,o['length']],'ratio':p/o['length']});}else{const {fns:w,stale:x}=counterpartFunctions(i,e);if(x){g['push']({'file':i,'mode':'file','exercised':![],'ratio':0x0,'stale':!![]});continue;}const y=a44a['readFileSync'](i,'utf-8'),{names:z}=enclosingFunctionNames(y,changedLines(i)??[]);if(z['length']===0x0){const C=anyExecuted(w);g['push']({'file':i,'mode':'file','exercised':C,'ratio':C?0x1:0x0});continue;}const A=z['filter'](D=>w['some'](E=>E['functionName']===D&&E['ranges']['length']>0x0&&E['ranges'][0x0]['count']>0x0)),B=z['filter'](D=>!A['includes'](D));g['push']({'file':i,'mode':'function','exercised':A['length']>0x0,'functions':{'executed':A,'missed':B},'ratio':A['length']/z['length']});}}const h=g['reduce']((D,E)=>D+E['ratio'],0x0)/g['length'];return{'measured':!![],'ratio':h,'files':g};}
|