@r_masseater/msch 0.83.0 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/changed.mjs +1 -1
- package/dist/cli.mjs +3 -4
- package/dist/cli.mjs.map +1 -1
- package/dist/config-BBdsNPSO.mjs +9 -0
- package/dist/config-BBdsNPSO.mjs.map +1 -0
- package/dist/config.mjs +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-Cmdgaxwj.mjs → define-lint-preset-ALNtaoIc.mjs} +4 -5
- package/dist/define-lint-preset-ALNtaoIc.mjs.map +1 -0
- package/dist/exits.mjs +1 -1
- package/dist/judge.d.mts +1 -0
- package/dist/judge.mjs +415 -0
- package/dist/judge.mjs.map +1 -0
- package/dist/lint-rules.mjs +1 -1
- package/dist/lint.mjs +1 -1
- package/dist/{lookup-report-BdUByHMt.mjs → lookup-report-VID9QVGU.mjs} +2 -2
- package/dist/{lookup-report-BdUByHMt.mjs.map → lookup-report-VID9QVGU.mjs.map} +1 -1
- package/dist/{output-BUCq_3DP.mjs → output-DYnV3b5B.mjs} +8 -3
- package/dist/output-DYnV3b5B.mjs.map +1 -0
- package/dist/published.mjs +1 -1
- package/dist/refs.mjs +1 -1
- package/dist/unbumped.mjs +1 -1
- package/dist/upstream.mjs +1 -1
- package/package.json +4 -3
- package/skills/msch-checks/SKILL.md +11 -0
- package/dist/config-C3jRfgJ9.mjs +0 -7
- package/dist/config-C3jRfgJ9.mjs.map +0 -1
- package/dist/define-lint-preset-Cmdgaxwj.mjs.map +0 -1
- package/dist/output-BUCq_3DP.mjs.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/shared/config/index.ts
|
|
2
|
+
const JAPANESE = /[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u;
|
|
3
|
+
/** @msch video.intro */
|
|
4
|
+
const VIDEO_INTROS = ["beats", "plain"];
|
|
5
|
+
const DECISION_MODEL = "cloudflare/@cf/cloudflare/clef-flash";
|
|
6
|
+
const DECISION_TIMEOUT_MS = 5e4;
|
|
7
|
+
export { VIDEO_INTROS as i, DECISION_TIMEOUT_MS as n, JAPANESE as r, DECISION_MODEL as t };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=config-BBdsNPSO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-BBdsNPSO.mjs","names":[],"sources":["../src/shared/config/index.ts"],"sourcesContent":["export const JAPANESE = /[\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Han}]/u;\n\n/** @msch video.intro */\nexport const VIDEO_INTROS = [\"beats\", \"plain\"] as const;\n\nexport type VideoIntro = (typeof VIDEO_INTROS)[number];\n\nexport const DECISION_MODEL = \"cloudflare/@cf/cloudflare/clef-flash\";\n\nexport const DECISION_TIMEOUT_MS = 50_000;\n"],"mappings":";AAAA,MAAa,WAAW;;AAGxB,MAAa,eAAe,CAAC,SAAS,OAAO;AAI7C,MAAa,iBAAiB;AAE9B,MAAa,sBAAsB"}
|
package/dist/config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as structureOf, l as requiredStack, m as generated, n as textlintFilters, p as decisionTestRules, r as textlintPresets, t as markdownOf, u as lint } from "./define-lint-preset-
|
|
1
|
+
import { i as structureOf, l as requiredStack, m as generated, n as textlintFilters, p as decisionTestRules, r as textlintPresets, t as markdownOf, u as lint } from "./define-lint-preset-ALNtaoIc.mjs";
|
|
2
2
|
import { Array, Option, Record, pipe } from "effect";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { recommended } from "@r_masseater/fu4/presets";
|
package/dist/decision-rules.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { h as default } from "./define-lint-preset-
|
|
1
|
+
export { h as default } from "./define-lint-preset-ALNtaoIc.mjs";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-BBdsNPSO.mjs";
|
|
2
2
|
import { createRequire, registerHooks } from "node:module";
|
|
3
3
|
import { Array, Option, Predicate, Record, String, Struct, pipe } from "effect";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { createDecisionPlugin, defineDecisionRule } from "@r_masseater/oxlint-plugin-decision";
|
|
5
6
|
import tanstackQuery from "@r_masseater/oxlint-typed-rules/tanstack-query";
|
|
6
7
|
import tanstackRouter from "@r_masseater/oxlint-typed-rules/tanstack-router";
|
|
7
8
|
import { plugin } from "@shadcn/lint";
|
|
@@ -10,7 +11,6 @@ import { presets } from "@effect/tsgo/oxlint-presets";
|
|
|
10
11
|
import htmlReact from "@html-eslint/eslint-plugin-react";
|
|
11
12
|
import eslintReact from "@r_masseater/oxlint-typed-rules/react";
|
|
12
13
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
13
|
-
import { createDecisionPlugin, defineDecisionRule } from "@r_masseater/oxlint-plugin-decision";
|
|
14
14
|
import remotion from "@r_masseater/oxlint-typed-rules/remotion";
|
|
15
15
|
import { rustCrate, skill, structure, workspace } from "@r_masseater/wism/presets";
|
|
16
16
|
import presetJa from "@r_masseater/textlint-rule-preset-ja";
|
|
@@ -265,7 +265,6 @@ const flakeMaskingSyntax = [
|
|
|
265
265
|
];
|
|
266
266
|
// src/features/define-lint-preset/config/preset.ts
|
|
267
267
|
const resolved = (specifier) => fileURLToPath(import.meta.resolve(specifier));
|
|
268
|
-
const DECISION_TIMEOUT_MS = 5e4;
|
|
269
268
|
const typedRules = "@r_masseater/oxlint-typed-rules";
|
|
270
269
|
const lint = {
|
|
271
270
|
ignorePatterns: generated,
|
|
@@ -482,7 +481,7 @@ const lint = {
|
|
|
482
481
|
}
|
|
483
482
|
],
|
|
484
483
|
settings: { [decisionPluginName]: {
|
|
485
|
-
model:
|
|
484
|
+
model: DECISION_MODEL,
|
|
486
485
|
timeoutMs: DECISION_TIMEOUT_MS,
|
|
487
486
|
ci: "skip"
|
|
488
487
|
} },
|
|
@@ -799,4 +798,4 @@ const markdownOf = ({ ignores = [], rules = {}, docs = {} }) => ({
|
|
|
799
798
|
});
|
|
800
799
|
export { cloudflareResourceSyntax as _, videoRules as a, removalPolicySyntax as b, INSTRUMENTATION as c, allRulesOf as d, decisionRules as f, alchemyOverride as g, decision_rules_default as h, structureOf as i, requiredStack as l, generated as m, textlintFilters as n, remotionRules as o, decisionTestRules as p, textlintPresets as r, tracedRules as s, markdownOf as t, lint as u, commandsOverride as v, removalPolicyOverride as y };
|
|
801
800
|
|
|
802
|
-
//# sourceMappingURL=define-lint-preset-
|
|
801
|
+
//# sourceMappingURL=define-lint-preset-ALNtaoIc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-lint-preset-ALNtaoIc.mjs","names":["Rec","Arr","Str","effectPresets","decisionPlugin","shadcn","Str","Arr","Rec"],"sources":["../src/features/define-lint-preset/config/lint-overrides.config.ts","../src/features/define-lint-preset/config/decision-rules.ts","../src/features/define-lint-preset/config/web-guidance.config.ts","../src/features/define-lint-preset/config/lint.config.ts","../src/features/define-lint-preset/config/test-rules.config.ts","../src/features/define-lint-preset/config/preset.ts","../src/features/define-lint-preset/config/required-stack.config.ts","../src/features/define-lint-preset/config/traced-rules.config.ts","../src/features/define-lint-preset/config/remotion-rules.config.ts","../src/features/define-lint-preset/config/video-rules.config.ts","../src/features/define-lint-preset/config/structure.config.ts","../src/features/define-lint-preset/config/kuromojin.config.ts","../src/features/define-lint-preset/config/textlint-presets.config.ts","../src/features/define-lint-preset/config/textlint-filters.config.ts","../src/features/define-lint-preset/config/markdown.config.ts"],"sourcesContent":["const LOGPUSH = 'Property[key.name=\"logpush\"]:not([value.value=false])';\nconst LOGPUSH_MESSAGE =\n \"Worker には logpush: true を付ける。付けないと、その Worker のログが Logpush に流れない\";\n\nconst CPU_LIMIT = 'Property[key.name=\"limits\"]:has(Property[key.name=\"cpuMs\"])';\nconst CPU_LIMIT_MESSAGE =\n \"コードを動かす Worker には limits.cpuMs を付け、本番の CPU 時間の最大値をわずかに上回る値にする。付けないと、1 回の暴走が上限の CPU 時間まで請求される\";\n\nconst UNATTRIBUTED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通し、呼び出し元を metadata に載せる。載せないと、費用やエラーを後から呼び出し元で引けない\";\n\nconst UNGATED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通す。通らない呼び出しには日ごとの費用の上限が掛からず、無料枠を超えた分がそのまま請求される\";\n\nconst MODEL_RUN =\n 'CallExpression[callee.property.name=\"run\"]:matches([callee.object.name=\"AI\"], [callee.object.property.name=\"AI\"])';\n\nconst AI_RUN_URL =\n \":matches(Literal[value=/ai.run/], TemplateLiteral:has(TemplateElement[value.raw=/ai.run/]))\";\n\nconst AI_RUN_REQUEST = `CallExpression:has(> ${AI_RUN_URL})`;\n\nexport const cloudflareResourceSyntax: readonly Readonly<{ selector: string; message: string }>[] =\n [\n {\n selector: `CallExpression[callee.object.name=\"Workers\"][callee.property.name=\"Worker\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=/^(Workers|Website)$/] > ObjectExpression.arguments:has(Property[key.name=\"main\"]):not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"]:not([callee.property.name=\"StaticSite\"]) > ObjectExpression.arguments:not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `${MODEL_RUN}[arguments.length<3]`,\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector: `${MODEL_RUN} > .arguments:nth-child(3):not(Identifier[name=\"options\"])`,\n message: `${UNGATED_MODEL_CALL}。AI.run の第 3 引数には、runWorkersAi の call が受け取る options をそのまま渡す`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments:not(:has(Property[key.name=\"headers\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments > Property[key.name=\"headers\"] > ObjectExpression:not(:has(Property[key.value=\"cf-aig-gateway-id\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector:\n 'CallExpression[callee.name=\"runWorkersAi\"] > ObjectExpression > Property[key.name=\"call\"] > ArrowFunctionExpression[params.length=0]',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.name=\"createAI\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'ObjectExpression:has(Property[key.value=\"cf-aig-gateway-id\"]):not(:has(Property[key.value=\"cf-aig-metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"collectLogs\"][value.value=true]))',\n message:\n \"AI Gateway には collectLogs: true を付ける。付けないと、モデルの呼び出しが後から引けない\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"spendLimits\"] > ObjectExpression > Property[key.name=\"enabled\"][value.value=true]))',\n message:\n \"AI Gateway には spendLimits を enabled: true で付け、日ごとの費用の上限を掛ける。付けないと、従量課金のモデルの呼び出しが上限なく請求される\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"cacheTtl\"]))',\n message:\n \"AI Gateway には cacheTtl を付け、同じ問いの答えをキャッシュする。付けないと、同じ問いにも毎回課金される\",\n },\n {\n selector: 'MemberExpression[object.name=\"Rum\"][property.name=\"Site\"]',\n message:\n \"Rum.Site は使わない。CI のトークンに Account Settings Write が要る。Cloudflare API でホストごとに一度サイトを作り、トークンを CF_BEACON_TOKEN に置く\",\n },\n ];\nexport const removalPolicySyntax: Readonly<{ selector: string; message: string }> = {\n selector:\n 'CallExpression[callee.object.name=/^(D1|R2)$/][callee.property.name=/^(Database|Bucket)$/]:not(CallExpression[callee.property.name=\"pipe\"][arguments.0.callee.object.name=\"RemovalPolicy\"] > MemberExpression.callee > CallExpression.object)',\n message:\n \"D1 と R2 は作り直すと中身が消えるので、alchemy の RemovalPolicy.protect() を .pipe で付けて置き換えと削除を止める\",\n};\n\nexport const removalPolicyOverride: {\n files: string[];\n excludeFiles: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/*.ts\"],\n excludeFiles: [\"**/*.test.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax, removalPolicySyntax],\n },\n};\n\nexport const alchemyOverride: {\n files: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/alchemy.run.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n removalPolicySyntax,\n {\n selector: 'CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])',\n message: \"スタック名には app-name.ts の APP_NAME を渡す\",\n },\n {\n selector:\n 'Program:not(:has(YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n {\n selector:\n 'CallExpression[callee.name=\"Stack\"] > .arguments:nth-child(3):not(:has(FunctionExpression > BlockStatement > ExpressionStatement:nth-last-child(2) > YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n ],\n },\n};\n\nexport const commandsOverride: {\n files: string[];\n rules: Readonly<Record<string, \"off\">>;\n} = {\n files: [\"bin/**\"],\n rules: {\n \"node/no-process-env\": \"off\",\n \"node/no-sync\": \"off\",\n \"effecttsgo/node-builtin-import\": \"off\",\n },\n};\n","import { createDecisionPlugin, defineDecisionRule } from \"@r_masseater/oxlint-plugin-decision\";\n\nexport default createDecisionPlugin({\n name: \"stack\",\n rules: [\n defineDecisionRule({\n id: \"exclusive-status\",\n target: \"file\",\n question:\n \"Does this code represent one piece of state with several boolean flags or optional fields whose combinations can contradict each other, instead of one exclusive status expressed as a discriminated union? Answer no when every state is a single exclusive status, or when the file holds no such state. A violation needs two or more booleans or optional fields that describe the same piece of state; a single boolean value, parameter, return value or field is not a violation, and a union of objects told apart by a status or kind field is already an exclusive status. A constant configuration object whose shape a library fixes, such as an OpenFeature flag definition, holds no state and is not a violation.\",\n message: \"状態は排他的なstatusを持つ判別共用体で表し、booleanフラグの組を使わない。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"server-state-tanstack-query\",\n target: \"file\",\n question:\n \"Does this code fetch, cache or synchronize server data on the client with something other than TanStack Query, such as fetch inside useEffect, SWR or a hand-written cache? Answer no when server data on the client goes only through TanStack Query, or when the file handles none. Creating an API client such as a better-auth or Eden client, which fetches nothing until a query calls it, is not a violation.\",\n message: \"サーバー状態はTanStack Queryだけで扱う。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"ui-state-effect-atom\",\n target: \"file\",\n question:\n \"Does this code hold client-side UI state with something other than effect-atom, such as useState, useReducer, React context used as a store, zustand, jotai or redux? Answer no when client-side UI state is held only by effect-atom, or when the file holds none. effect-atom is Atom from effect/reactivity, read and written through @effect/atom-react hooks such as useAtomValue and useAtomSet. Creating a TanStack Query QueryClient or configuring the router, which hold no UI state, is not a violation.\",\n message: \"UI状態はeffect-atomだけで扱う。\",\n cutoff: 0.8,\n }),\n ],\n});\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nexport const webGuidanceRules = {\n \"jsx-a11y/no-redundant-roles\": [\"error\", { ul: [\"list\"], ol: [\"list\"] }],\n \"jsx-a11y/no-noninteractive-tabindex\": [\"error\", { tags: [\"section\"], roles: [\"tabpanel\"] }],\n} satisfies LintRules;\n","import { presets as effectPresets } from \"@effect/tsgo/oxlint-presets\";\nimport htmlReact from \"@html-eslint/eslint-plugin-react\";\nimport eslintReact from \"@r_masseater/oxlint-typed-rules/react\";\nimport { Array as Arr, Record as Rec, String as Str, Struct, pipe } from \"effect\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\n\nexport const generated = [\n \"**/routeTree.gen.ts\",\n \"**/generated/**\",\n \"**/drizzle/**/snapshot.json\",\n \".claude/skills/**\",\n \".intent/**\",\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \"**/CHANGELOG.md\",\n \".github/release-please/*manifest.json\",\n \"**/.release-please-manifest.json\",\n \"**/*.d.*.ts\",\n \"**/src-tauri/gen/**\",\n];\n\nconst asErrors = (names: readonly string[]): Readonly<Record<string, \"error\">> =>\n Rec.fromEntries(\n pipe(\n names,\n Arr.map((name) => [name, \"error\"] as const),\n ),\n );\n\nexport const allRulesOf = ({\n prefix,\n rules,\n}: Readonly<{ prefix: string; rules: Readonly<Record<string, unknown>> }>): Readonly<\n Record<string, \"error\">\n> =>\n asErrors(\n pipe(\n Rec.keys(rules),\n Arr.map((rule) => `${prefix}/${rule}`),\n ),\n );\n\nconst reactHooksRuleNames = pipe(\n Struct.keys(reactHooks.configs[\"recommended-latest\"].rules),\n Arr.map(Str.replace(\"react-hooks/\", \"react-hooks-js/\")),\n);\n\nconst reactHooksRules = asErrors(reactHooksRuleNames);\n\nconst eslintReactRuleNames = pipe(\n Rec.keys(eslintReact.configs[\"strict-typescript\"].rules ?? {}),\n Arr.filter(\n (name) => !(Str.replace(\"@eslint-react/\", \"react-hooks-js/\")(name) in reactHooksRules),\n ),\n);\n\nconst effectRuleNames = pipe(\n Rec.values(effectPresets),\n Arr.flatMap((preset) => Struct.keys(preset.rules ?? {})),\n);\n\nexport const pluginRules: Readonly<Record<string, \"error\">> = {\n ...asErrors(Rec.keys(htmlReact.configs.all.rules ?? {})),\n ...reactHooksRules,\n ...asErrors(eslintReactRuleNames),\n ...asErrors(effectRuleNames),\n};\n\nexport const decisionPluginName = decisionPlugin.meta.name;\n\nexport const decisionRules = allRulesOf({\n prefix: decisionPluginName,\n rules: decisionPlugin.rules,\n});\n\nexport const decisionTestRules = pipe(\n decisionRules,\n Rec.map(() => \"off\" as const),\n);\n\nexport const shadcnRestyleContracts = [\n { pattern: \"^Table(Head|Cell)$\", allow: [\"text-alignment\", \"fvn-spacing\"] },\n { pattern: \"^TableCaption$\", allow: [\"caption\", \"text-alignment\", \"mt-*\", \"mb-*\"] },\n];\n\nexport { webGuidanceRules } from \"./web-guidance.config.ts\";\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nconst NO_TEST_DOUBLES =\n \"依存の振る舞いを差し替えない。Effect の Layer を差し替えるか、本物の実装を使う\";\n\nexport const testRules = {\n \"vitest/expect-expect\": [\n \"error\",\n { assertFunctionNames: [\"expect\", \"expect*\", \"assert*\", \"waitFor*\", \"run\", \"*.run\"] },\n ],\n \"vitest/valid-expect\": [\"error\", { maxArgs: 2 }],\n \"vitest/valid-title\": [\"error\", { allowArguments: true }],\n \"vitest/prefer-called-times\": \"off\",\n \"vitest/prefer-import-in-mock\": \"off\",\n \"vitest/no-standalone-expect\": \"off\",\n \"vitest/no-conditional-in-test\": \"off\",\n \"vitest/require-test-timeout\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/require-top-level-describe\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/require-hook\": \"off\",\n \"vitest/no-hooks\": \"off\",\n \"vitest/consistent-test-it\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/padding-around-after-all-blocks\": \"off\",\n \"vitest/padding-around-test-blocks\": \"off\",\n \"vitest/max-expects\": \"off\",\n} satisfies LintRules;\n\nconst NO_FLAKE_MASKING =\n \"再試行や flakyTest で不安定なテストを隠さない。待つ対象のイベントを await して直す\";\n\nexport const testDoubleSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=/^(mock|doMock)$/]',\n message: NO_TEST_DOUBLES,\n },\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=\"stubGlobal\"]',\n message: NO_TEST_DOUBLES,\n },\n];\n\nexport const flakeMaskingSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n { selector: 'Property[key.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"flakyTest\"]', message: NO_FLAKE_MASKING },\n];\n","import { fileURLToPath } from \"node:url\";\n\nimport tanstackQuery from \"@r_masseater/oxlint-typed-rules/tanstack-query\";\nimport tanstackRouter from \"@r_masseater/oxlint-typed-rules/tanstack-router\";\nimport { plugin as shadcn } from \"@shadcn/lint\";\nimport baselineJs from \"eslint-plugin-baseline-js\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { DECISION_MODEL, DECISION_TIMEOUT_MS } from \"#/shared/config/index.ts\";\n\nimport {\n alchemyOverride,\n cloudflareResourceSyntax,\n removalPolicyOverride,\n commandsOverride,\n} from \"./lint-overrides.config.ts\";\nimport {\n allRulesOf,\n decisionPluginName,\n generated,\n pluginRules,\n shadcnRestyleContracts,\n webGuidanceRules,\n} from \"./lint.config.ts\";\nimport { flakeMaskingSyntax, testDoubleSyntax, testRules } from \"./test-rules.config.ts\";\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst resolved = (specifier: string): string => fileURLToPath(import.meta.resolve(specifier));\n\nconst typedRules = \"@r_masseater/oxlint-typed-rules\";\n\nconst jsPlugins = [\n { name: \"vite-plus\", specifier: resolved(\"vite-plus/oxlint-plugin\") },\n { name: \"tanstack-query\", specifier: resolved(`${typedRules}/tanstack-query`) },\n { name: \"tanstack-router\", specifier: resolved(`${typedRules}/tanstack-router`) },\n { name: \"tanstack-start\", specifier: resolved(`${typedRules}/tanstack-start`) },\n { name: \"drizzle\", specifier: resolved(`${typedRules}/drizzle`) },\n { name: \"react-hooks-js\", specifier: resolved(\"eslint-plugin-react-hooks\") },\n { name: \"@eslint-react\", specifier: resolved(`${typedRules}/react`) },\n { name: \"@remotion\", specifier: resolved(`${typedRules}/remotion`) },\n { name: \"shadcn\", specifier: resolved(\"@shadcn/lint\") },\n { name: \"baseline-js\", specifier: resolved(\"eslint-plugin-baseline-js\") },\n { name: \"@html-eslint/react\", specifier: resolved(\"@html-eslint/eslint-plugin-react\") },\n { name: \"eslint-js\", specifier: resolved(\"oxlint-plugin-eslint\") },\n { name: decisionPluginName, specifier: resolved(\"@r_masseater/msch/decision-rules\") },\n { name: \"msch-lint\", specifier: resolved(\"@r_masseater/msch/lint-rules\") },\n];\n\nconst rules = {\n \"vite-plus/prefer-vite-plus-imports\": \"error\",\n \"tanstack-start/no-async-client-component\": \"error\",\n \"tanstack-start/no-client-code-in-server-component\": \"error\",\n ...allRulesOf({ prefix: \"tanstack-query\", rules: tanstackQuery.rules }),\n ...allRulesOf({ prefix: \"tanstack-router\", rules: tanstackRouter.rules }),\n \"drizzle/enforce-delete-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n \"drizzle/enforce-update-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n ...allRulesOf({ prefix: \"shadcn\", rules: shadcn.rules }),\n \"shadcn/no-restyle\": [\"error\", { contracts: shadcnRestyleContracts }],\n ...allRulesOf({ prefix: \"baseline-js\", rules: baselineJs.rules }),\n ...baselineJs.configs.recommended().rules,\n \"baseline-js/use-baseline\": [\n \"error\",\n {\n available: \"widely\",\n includeWebApis: { preset: \"auto\" },\n includeJsBuiltins: { preset: \"auto\" },\n },\n ],\n ...pluginRules,\n \"eslint/capitalized-comments\": \"off\",\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/exports-last\": \"off\",\n ...testRules,\n ...webGuidanceRules,\n \"msch-lint/array-from-async\": \"error\",\n \"msch-lint/ecosystem-readers\": \"error\",\n \"msch-lint/explicit-import-path\": \"error\",\n \"msch-lint/get-or-insert\": \"error\",\n \"msch-lint/mcp-tool-layer\": \"error\",\n \"msch-lint/main-through-node-main\": \"error\",\n \"msch-lint/inline-exports\": \"error\",\n \"msch-lint/ui-state-in-atoms\": \"error\",\n \"msch-lint/no-hand-written-sql\": \"error\",\n \"msch-lint/platform-node-by-module\": \"error\",\n \"msch-lint/readonly-parameters\": \"error\",\n \"msch-lint/typed-calls-not-reflect\": \"error\",\n \"react/react-in-jsx-scope\": \"off\",\n \"eslint/no-undef\": \"off\",\n \"typescript/promise-function-async\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"eslint/new-cap\": [\"error\", { capIsNew: false }],\n \"eslint/one-var\": [\"error\", \"never\"],\n \"unicorn/relative-url-style\": [\"error\", \"always\"],\n \"eslint/id-length\": [\"error\", { exceptions: [\"x\", \"y\"] }],\n \"jsdoc/check-tag-names\": [\"error\", { definedTags: [\"msch\", \"stability\"] }],\n \"jsdoc/require-param\": [\"error\", { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] }],\n \"jsdoc/require-returns\": [\n \"error\",\n { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] },\n ],\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax],\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"arrow-function\", unnamedComponents: \"arrow-function\" },\n ],\n \"typescript/no-empty-interface\": [\"error\", { allowSingleExtends: true }],\n \"typescript/no-empty-object-type\": [\"error\", { allowInterfaces: \"with-single-extends\" }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\".tsx\"] }],\n \"react/only-export-components\": [\"error\", { allowExportNames: [\"Route\"] }],\n} satisfies LintConfig[\"rules\"];\n\nconst overrides = [\n removalPolicyOverride,\n alchemyOverride,\n {\n files: [\"**/*.config.ts\", \"**/alchemy.*.ts\", \"**/decision-rules.ts\"],\n rules: { \"import/no-default-export\": \"off\" },\n },\n commandsOverride,\n {\n files: [\"**/bin/**\"],\n rules: { \"baseline-js/use-baseline\": \"off\" },\n },\n {\n files: [\"**/node-main/src/**\"],\n rules: { \"msch-lint/main-through-node-main\": \"off\" },\n },\n {\n files: [\"**/*.test.ts\", \"**/*.test.tsx\", \"**/*.test.support.ts\", \"**/vite.config.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n ...flakeMaskingSyntax,\n ...testDoubleSyntax,\n ],\n },\n },\n {\n files: [\"**/vite.config.ts\"],\n rules: {\n \"eslint/max-lines\": \"off\",\n \"eslint/max-lines-per-function\": \"off\",\n \"baseline-js/use-baseline\": \"off\",\n },\n },\n] satisfies LintConfig[\"overrides\"];\n\nexport const lint = {\n ignorePatterns: generated,\n plugins: [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"react\",\n \"react-perf\",\n \"jsx-a11y\",\n \"jsdoc\",\n \"vitest\",\n \"promise\",\n \"node\",\n \"effecttsgo\",\n ],\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n restriction: \"error\",\n nursery: \"error\",\n },\n jsPlugins,\n rules,\n overrides,\n settings: {\n [decisionPluginName]: {\n model: DECISION_MODEL,\n timeoutMs: DECISION_TIMEOUT_MS,\n ci: \"skip\",\n },\n },\n options: {\n typeAware: true,\n typeCheck: true,\n denyWarnings: true,\n reportUnusedDisableDirectives: \"error\",\n },\n} satisfies LintConfig;\n","const UI_STATE = \"UI 状態は effect-atom だけで扱う\";\n\nexport const INSTRUMENTATION = \"計装は Effect のトレーシングだけで扱う\";\nconst INFRASTRUCTURE = \"インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない\";\n\nexport const requiredStack: Readonly<Record<string, readonly string[]>> = {\n [UI_STATE]: [\n \"zustand\",\n \"jotai\",\n \"valtio\",\n \"recoil\",\n \"mobx\",\n \"mobx-*\",\n \"redux\",\n \"@reduxjs/*\",\n \"react-redux\",\n \"xstate\",\n \"@xstate/*\",\n \"nanostores\",\n \"@nanostores/*\",\n \"@preact/signals*\",\n ],\n \"サーバー状態は TanStack Query と Eden だけで扱う\": [\n \"swr\",\n \"react-query\",\n \"@apollo/*\",\n \"urql\",\n \"@urql/*\",\n \"axios\",\n \"ky\",\n \"ofetch\",\n \"got\",\n \"node-fetch\",\n \"graphql-request\",\n \"@trpc/*\",\n ],\n \"ルーティングとサーバーは TanStack Start と Elysia だけで扱う\": [\n \"react-router\",\n \"react-router-dom\",\n \"next\",\n \"@remix-run/*\",\n \"wouter\",\n \"express\",\n \"hono\",\n \"fastify\",\n \"koa\",\n \"@nestjs/*\",\n ],\n \"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する\": [\n \"prisma\",\n \"@prisma/*\",\n \"typeorm\",\n \"sequelize\",\n \"kysely\",\n \"knex\",\n \"@mikro-orm/*\",\n \"better-sqlite3\",\n \"pg\",\n \"mysql2\",\n ],\n \"認証は better-auth だけで扱う\": [\n \"next-auth\",\n \"@auth/*\",\n \"lucia\",\n \"passport\",\n \"passport-*\",\n \"@clerk/*\",\n \"firebase/auth\",\n \"@supabase/*\",\n ],\n \"UI は shadcn/ui と Tailwind CSS だけで組む\": [\n \"@mui/*\",\n \"antd\",\n \"@chakra-ui/*\",\n \"@mantine/*\",\n \"styled-components\",\n \"@emotion/*\",\n \"bootstrap\",\n \"react-bootstrap\",\n ],\n \"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う\": [\n \"zod\",\n \"yup\",\n \"joi\",\n \"valibot\",\n \"arktype\",\n \"io-ts\",\n \"superstruct\",\n \"moment\",\n \"dayjs\",\n \"date-fns\",\n \"luxon\",\n \"winston\",\n \"pino\",\n \"bunyan\",\n \"loglevel\",\n \"lodash\",\n \"lodash-es\",\n \"ramda\",\n \"rxjs\",\n \"fp-ts\",\n \"neverthrow\",\n \"ts-results\",\n \"purify-ts\",\n ],\n \"CSV は effect/encoding の Csv だけで読み書きする\": [\n \"papaparse\",\n \"csv-parse\",\n \"csv-parser\",\n \"csv-stringify\",\n \"fast-csv\",\n \"@fast-csv/*\",\n \"d3-dsv\",\n ],\n \"tar は effect/encoding の Tar だけで読み書きする\": [\n \"modern-tar\",\n \"nanotar\",\n \"tar\",\n \"tar-stream\",\n \"tar-fs\",\n \"tar-js\",\n \"tarts\",\n \"it-tar\",\n ],\n \"エージェントスキルは vite.config.ts の skills に書き、msch --prepare で入れる\": [\"skills\"],\n \"フィーチャーフラグは OpenFeature だけで扱う\": [\n \"launchdarkly-*\",\n \"@launchdarkly/*\",\n \"@growthbook/*\",\n \"unleash-client\",\n \"flagsmith\",\n \"@vercel/flags\",\n ],\n \"テストは Vitest と Playwright だけで扱う\": [\n \"jest\",\n \"jest-*\",\n \"@jest/*\",\n \"ts-jest\",\n \"mocha\",\n \"jasmine\",\n \"jasmine-core\",\n \"ava\",\n \"cypress\",\n \"tap\",\n \"uvu\",\n ],\n \"決済は Stripe だけで扱う\": [\n \"@paypal/*\",\n \"paypal-rest-sdk\",\n \"braintree\",\n \"@paddle/*\",\n \"@lemonsqueezy/*\",\n \"square\",\n ],\n \"整形は Vite+ の vp fmt だけで扱う\": [\n \"prettier\",\n \"prettier-plugin-*\",\n \"@prettier/*\",\n \"@biomejs/*\",\n \"dprint\",\n ],\n \"lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む\": [\n \"eslint\",\n \"@eslint/*\",\n \"eslint-config-*\",\n \"tslint\",\n \"standard\",\n \"xo\",\n ],\n [INSTRUMENTATION]: [\"@opentelemetry/*\", \"dd-trace\", \"newrelic\"],\n [INFRASTRUCTURE]: [\n \"wrangler\",\n \"miniflare\",\n \"@cloudflare/vite-plugin\",\n \"@vercel/*\",\n \"@netlify/*\",\n \"aws-cdk\",\n \"aws-cdk-lib\",\n \"@pulumi/*\",\n \"cdktf\",\n ],\n};\n","export const tracedRules = {\n \"msch-lint/traced-elysia\": \"error\",\n \"msch-lint/traced-effect-run\": \"error\",\n} as const;\n","import remotion from \"@r_masseater/oxlint-typed-rules/remotion\";\n\nimport { allRulesOf } from \"./lint.config.ts\";\n\nexport const remotionRules = allRulesOf({ prefix: \"@remotion\", rules: remotion.rules });\n","import type { VideoIntro } from \"#/shared/config/index.ts\";\n\nexport interface VideoSayOptions {\n readonly terms?: Readonly<Record<string, string>>;\n readonly banned?: Readonly<Record<string, string>>;\n readonly maxEmphasis?: number;\n}\n\nexport interface VideoSeriesOptions {\n readonly values?: Readonly<Record<string, string>>;\n readonly voices?: readonly string[];\n readonly opener?: string;\n readonly closer?: string;\n readonly intro?: VideoIntro;\n readonly afterIntro?: Readonly<Record<string, string>>;\n}\n\nexport interface VideoRulesOptions {\n readonly say: VideoSayOptions;\n readonly series: Readonly<Record<string, VideoSeriesOptions>>;\n readonly banned?: Readonly<Record<string, string>>;\n}\n\nexport const videoRules = ({ say, series, banned = {} }: VideoRulesOptions) =>\n ({\n \"msch-lint/video-say\": [\"error\", say],\n \"msch-lint/video-readings\": \"error\",\n \"msch-lint/video-series\": [\"error\", { series, banned }],\n }) as const;\n","import type { WismConfig } from \"@r_masseater/wism\";\nimport { rustCrate, skill, structure, workspace } from \"@r_masseater/wism/presets\";\nimport { Array as Arr, Predicate, String as Str, pipe } from \"effect\";\n\nconst NEGATION = \"!\";\nconst isIgnore = Predicate.not(Str.startsWith(NEGATION));\n\nexport interface StructureOptions {\n readonly members: readonly string[];\n readonly ignorePatterns: readonly string[];\n}\n\nexport const structureOf = ({ members, ignorePatterns }: StructureOptions): WismConfig =>\n structure({\n kinds: [workspace({ paths: members }), rustCrate(), skill()],\n ignores: pipe(ignorePatterns, Arr.filter(isIgnore)),\n });\n","import { createRequire, registerHooks } from \"node:module\";\n\nexport const KUROMOJIN = \"kuromojin\";\nconst ON_Y8 = \"@r_masseater/y8/kuromojin\";\n\nexport const requireWithY8Kuromojin = (parentUrl: string): NodeJS.Require => {\n registerHooks({\n resolve: (specifier, context, nextResolve) => {\n if (specifier === KUROMOJIN) {\n return nextResolve(ON_Y8, { ...context, parentURL: import.meta.url });\n }\n return nextResolve(specifier, context);\n },\n });\n return createRequire(parentUrl);\n};\n","import presetJa from \"@r_masseater/textlint-rule-preset-ja\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, Record as Rec, pipe } from \"effect\";\n\nimport { JAPANESE } from \"#/shared/config/index.ts\";\n\nimport { requireWithY8Kuromojin } from \"./kuromojin.config.ts\";\n\ntype Preset = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]>[string];\ntype Rule = Preset[\"rules\"][string];\ntype Reporter = Extract<Rule, (...args: never) => unknown>;\ntype Fixable = Exclude<Rule, Reporter>;\n\nconst NO_HANDLERS = {};\n\nconst isPreset = (value: unknown): value is Preset =>\n Predicate.hasProperty(value, \"rules\") &&\n Predicate.isObject(value.rules) &&\n Predicate.hasProperty(value, \"rulesConfig\") &&\n Predicate.isObject(value.rulesConfig);\n\nconst presetIn = (value: unknown): Option.Option<Preset> => {\n if (isPreset(value)) {\n return Option.some(value);\n }\n if (Predicate.hasProperty(value, \"default\")) {\n return presetIn(value.default);\n }\n return Option.none();\n};\n\nconst required = requireWithY8Kuromojin(import.meta.url);\n\nconst presetOf = (specifier: string, loaded: unknown): Preset =>\n Option.getOrThrowWith(\n presetIn(loaded),\n () => new TypeError(`${specifier} does not export a textlint preset`),\n );\n\nconst japaneseOnly =\n (reporter: Reporter): Reporter =>\n (context, options) => {\n if (JAPANESE.test(context.getSource())) {\n return reporter(context, options);\n }\n return NO_HANDLERS;\n };\n\nconst forJapanese = (rule: Reporter | Readonly<Fixable>): Rule => {\n if (Predicate.isFunction(rule)) {\n return japaneseOnly(rule);\n }\n return { linter: japaneseOnly(rule.linter), fixer: japaneseOnly(rule.fixer) };\n};\n\nconst japanesePreset = (specifier: string, loaded: unknown): Preset => {\n const { rules, rulesConfig } = presetOf(specifier, loaded);\n return { rules: pipe(rules, Rec.map(forJapanese)), rulesConfig };\n};\n\nexport const textlintPresets: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]> = {\n \"@r_masseater/preset-ja\": japanesePreset(\"@r_masseater/textlint-rule-preset-ja\", presetJa),\n \"@textlint-ja/preset-ai-writing\": japanesePreset(\n \"@textlint-ja/textlint-rule-preset-ai-writing\",\n required(\"@textlint-ja/textlint-rule-preset-ai-writing\"),\n ),\n \"preset-ja-technical-writing\": japanesePreset(\n \"textlint-rule-preset-ja-technical-writing\",\n required(\"textlint-rule-preset-ja-technical-writing\"),\n ),\n};\n","import { createRequire } from \"node:module\";\n\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, pipe } from \"effect\";\n\ntype Filter = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]>[string];\n\nconst isFilter = (value: unknown): value is Filter => Predicate.isFunction(value);\n\nconst filterIn = (specifier: string, loaded: unknown): Filter =>\n pipe(\n Option.liftPredicate(loaded, isFilter),\n Option.getOrThrowWith(() => new TypeError(`${specifier} does not export a textlint filter`)),\n );\n\nexport const textlintFilters: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]> =\n {\n comments: filterIn(\n \"textlint-filter-rule-comments\",\n createRequire(import.meta.url)(\"textlint-filter-rule-comments\"),\n ),\n };\n","import type { RuleEntry, Y8Config } from \"@r_masseater/y8\";\nimport { recommended } from \"@r_masseater/y8/presets\";\nimport type { RecommendedOptions } from \"@r_masseater/y8/presets\";\n\nconst INDEX_SKILL = \"masseater-style\";\n\nconst MASSEATER_DOCS: RecommendedOptions = {\n agents: {\n sections: [[\"Tech stack\"], [\"Commands\"], [\"Rules\"]],\n commands: [\"Commands\"],\n stack: [\"Tech stack\"],\n skillNames: { index: INDEX_SKILL },\n },\n skills: { skillNames: { index: INDEX_SKILL } },\n};\n\nconst MARKDOWN_IGNORES = [\n \".agents/skills/**\",\n \"**/fixtures/**\",\n \"**/upstream/**\",\n \"CHANGELOG.md\",\n \"**/CLAUDE.md\",\n];\n\nexport interface MarkdownOptions {\n readonly ignores?: readonly string[];\n readonly rules?: Readonly<Record<string, RuleEntry>>;\n readonly docs?: RecommendedOptions;\n}\n\nexport const markdownOf = ({ ignores = [], rules = {}, docs = {} }: MarkdownOptions): Y8Config => ({\n extends: [\n recommended({\n ...MASSEATER_DOCS,\n ...docs,\n agents: { ...MASSEATER_DOCS.agents, ...docs.agents },\n skills: { ...MASSEATER_DOCS.skills, ...docs.skills },\n }),\n ],\n rules: { \"agnix/XP-001\": \"off\", ...rules },\n reportUnusedDirectives: true,\n ignores: [...MARKDOWN_IGNORES, ...ignores],\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAM,UAAU;AAChB,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;;ACxMA,MAAM,WAAW;AAEjB,MAAa,kBAAkB;AAC/B,MAAM,iBAAiB;AAEvB,MAAa,gBAA6D;EACvE,WAAW;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8CAA8C;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4CAA4C;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yBAAyB;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,qCAAqC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yCAAyC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yCAAyC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8DAA8D,CAAC,QAAQ;CACvE,gCAAgC;EAC9B;EACA;EACA;EACA;EACA;EACA;CACF;CACA,kCAAkC;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,oBAAoB;EAClB;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4BAA4B;EAC1B;EACA;EACA;EACA;EACA;CACF;CACA,sEAAsE;EACpE;EACA;EACA;EACA;EACA;EACA;CACF;EACC,kBAAkB;EAAC;EAAoB;EAAY;CAAU;EAC7D,iBAAiB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;ACrLA,MAAa,cAAc;CACzB,2BAA2B;CAC3B,+BAA+B;AACjC;;ACCA,MAAa,gBAAgB,WAAW;CAAE,QA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jG,SAAS,CACP,YAAY;EACV,GAAG;EACH,GAAG;EACH,QAAQ;GAAE,GAAG,eAAe;GAAQ,GAAG,KAAK;EAAO;EACnD,QAAQ;GAAE,GAAG,eAAe;GAAQ,GAAG,KAAK;EAAO;CACrD,CAAC,CACH;CACA,OAAO;EAAE,gBAAgB;EAAO,GAAG;CAAM;CACzC,wBAAwB;CACxB,SAAS,CAAC,GAAG,kBAAkB,GAAG,OAAO;AAC3C"}
|
package/dist/exits.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as lookupReport } from "./lookup-report-
|
|
2
|
+
import { t as lookupReport } from "./lookup-report-VID9QVGU.mjs";
|
|
3
3
|
import { t as runCli } from "./runtime-CFZ41rB0.mjs";
|
|
4
4
|
import { n as upstreamExitsMet } from "./upstream-exits-2ut4fmJv.mjs";
|
|
5
5
|
import { n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
package/dist/judge.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/judge.mjs
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-DYnV3b5B.mjs";
|
|
3
|
+
import { t as runCli } from "./runtime-CFZ41rB0.mjs";
|
|
4
|
+
import { n as DECISION_TIMEOUT_MS, t as DECISION_MODEL } from "./config-BBdsNPSO.mjs";
|
|
5
|
+
import { a as problemAtPosition, o as problemInFile, s as sortProblems } from "./problem-OJg859cN.mjs";
|
|
6
|
+
import { n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
7
|
+
import { t as JSON_FLAG } from "./cli-contract-D7btWrEu.mjs";
|
|
8
|
+
import { Array, Effect, FileSystem, Option, Order, Path, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
9
|
+
import { ChildProcess } from "effect/process";
|
|
10
|
+
import { judgeText } from "@r_masseater/oxlint-plugin-decision";
|
|
11
|
+
// src/features/judge-documents/model/agent-prompt.ts
|
|
12
|
+
/** @internal */
|
|
13
|
+
const AgentAnswer = Schema.Struct({
|
|
14
|
+
verdict: Schema.Literals([
|
|
15
|
+
"violation",
|
|
16
|
+
"pass",
|
|
17
|
+
"unknown"
|
|
18
|
+
]),
|
|
19
|
+
quote: Schema.String,
|
|
20
|
+
reason: Schema.String
|
|
21
|
+
});
|
|
22
|
+
/** @internal */
|
|
23
|
+
const AGENT_SCHEMA = Schema.toJsonSchemaDocument(AgentAnswer).schema;
|
|
24
|
+
const listOf = (names) => pipe(names, Array.map((name) => `- ${name}`), Array.join("\n"));
|
|
25
|
+
const readableNames = (context) => pipe(context, Array.map(({ name }) => name));
|
|
26
|
+
/** @internal */
|
|
27
|
+
const promptOf = ({ rule, target, context }) => pipe([
|
|
28
|
+
"Judge one rule against one file. The working directory holds only the files you may read.",
|
|
29
|
+
`Rule: ${rule.question}`,
|
|
30
|
+
`Target file: ${target.name}`,
|
|
31
|
+
"Other readable files:",
|
|
32
|
+
listOf(readableNames(context)),
|
|
33
|
+
"Read the target file, and read the other files when the rule needs them.",
|
|
34
|
+
"Answer \"violation\" only when the target file breaks the rule, \"pass\" when it does not, and \"unknown\" when these files do not let you decide.",
|
|
35
|
+
"For a violation, copy the offending text from the target file exactly as written into quote, without paraphrase and without added or removed characters. Leave quote empty otherwise.",
|
|
36
|
+
"Give the reason in one sentence."
|
|
37
|
+
], Array.join("\n"));
|
|
38
|
+
// src/features/judge-documents/model/verdict.ts
|
|
39
|
+
const LINE_BREAK = "\n";
|
|
40
|
+
const FIRST_LINE = 1;
|
|
41
|
+
const START = 0;
|
|
42
|
+
const Violation = Schema.Struct({
|
|
43
|
+
status: Schema.Literal("violation"),
|
|
44
|
+
line: Schema.Int,
|
|
45
|
+
quote: Schema.String,
|
|
46
|
+
reason: Schema.String
|
|
47
|
+
});
|
|
48
|
+
const Pass = Schema.Struct({ status: Schema.Literal("pass") });
|
|
49
|
+
Schema.Struct({
|
|
50
|
+
status: Schema.Literal("unknown"),
|
|
51
|
+
reason: Schema.String
|
|
52
|
+
});
|
|
53
|
+
/** @internal */
|
|
54
|
+
const DecidedVerdictSchema = Schema.Union([Violation, Pass]);
|
|
55
|
+
/** @internal */
|
|
56
|
+
const unknownBecause = (reason) => ({
|
|
57
|
+
status: "unknown",
|
|
58
|
+
reason
|
|
59
|
+
});
|
|
60
|
+
/** @internal */
|
|
61
|
+
const isDecided = (verdict) => verdict.status !== "unknown";
|
|
62
|
+
/** @internal */
|
|
63
|
+
const lineOfQuote = ({ text, quote }) => {
|
|
64
|
+
if (String$1.isEmpty(quote)) return Option.none();
|
|
65
|
+
return pipe(String$1.indexOf(quote)(text), Option.map((index) => pipe(String$1.slice(START, index)(text), String$1.split(LINE_BREAK)).length));
|
|
66
|
+
};
|
|
67
|
+
/** @internal */
|
|
68
|
+
const textOfLine = ({ text, line }) => pipe(String$1.split(text, LINE_BREAK), Array.get(line - FIRST_LINE), Option.getOrElse(() => ""));
|
|
69
|
+
// src/features/judge-documents/model/agent-judge.ts
|
|
70
|
+
const AGENT_MODEL = "claude-sonnet-5-5";
|
|
71
|
+
const AGENT_EFFORT = "medium";
|
|
72
|
+
const AGENT_TOOLS = "Read,Grep,Glob";
|
|
73
|
+
const AGENT_TIMEOUT = "10 minutes";
|
|
74
|
+
const SUCCESS = 0;
|
|
75
|
+
const STDERR_TAIL = 400;
|
|
76
|
+
/** @internal */
|
|
77
|
+
const CLAUDE = { command: ["claude"] };
|
|
78
|
+
const ClaudeResult = Schema.Struct({
|
|
79
|
+
is_error: Schema.Boolean,
|
|
80
|
+
structured_output: Schema.optional(AgentAnswer)
|
|
81
|
+
});
|
|
82
|
+
const decodeResult = Schema.decodeUnknownEffect(Schema.fromJsonString(ClaudeResult));
|
|
83
|
+
const encodeJson$1 = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
|
|
84
|
+
const argsOf = (input, schema) => [
|
|
85
|
+
"-p",
|
|
86
|
+
promptOf(input),
|
|
87
|
+
"--model",
|
|
88
|
+
AGENT_MODEL,
|
|
89
|
+
"--effort",
|
|
90
|
+
AGENT_EFFORT,
|
|
91
|
+
"--restricted",
|
|
92
|
+
"--tools",
|
|
93
|
+
AGENT_TOOLS,
|
|
94
|
+
"--strict-mcp-config",
|
|
95
|
+
"--disable-slash-commands",
|
|
96
|
+
"--no-session-persistence",
|
|
97
|
+
"--permission-mode",
|
|
98
|
+
"dontAsk",
|
|
99
|
+
"--permission-prompts",
|
|
100
|
+
"none",
|
|
101
|
+
"--output-format",
|
|
102
|
+
"json",
|
|
103
|
+
"--json-schema",
|
|
104
|
+
schema
|
|
105
|
+
];
|
|
106
|
+
const sandboxOf = Effect.fn("sandboxOf")(function* sandboxOf(files) {
|
|
107
|
+
const fs = yield* FileSystem.FileSystem;
|
|
108
|
+
const path = yield* Path.Path;
|
|
109
|
+
const directory = yield* fs.makeTempDirectoryScoped({ prefix: "msch-judge-" });
|
|
110
|
+
yield* Effect.forEach(files, ({ name, text }) => {
|
|
111
|
+
const file = path.join(directory, name);
|
|
112
|
+
return fs.makeDirectory(path.dirname(file), { recursive: true }).pipe(Effect.andThen(fs.writeFileString(file, text)));
|
|
113
|
+
}, {
|
|
114
|
+
concurrency: "unbounded",
|
|
115
|
+
discard: true
|
|
116
|
+
});
|
|
117
|
+
return directory;
|
|
118
|
+
});
|
|
119
|
+
const textOf = (stream) => stream.pipe(Stream.decodeText(), Stream.mkString);
|
|
120
|
+
const runClaude = Effect.fn("runClaude")(function* runClaude(setup, call) {
|
|
121
|
+
const [command, ...prefix] = setup.command;
|
|
122
|
+
const handle = yield* ChildProcess.make(command, [...prefix, ...call.args], {
|
|
123
|
+
cwd: call.directory,
|
|
124
|
+
stdin: "ignore"
|
|
125
|
+
});
|
|
126
|
+
const [stdout, stderr, code] = yield* Effect.all([
|
|
127
|
+
textOf(handle.stdout),
|
|
128
|
+
textOf(handle.stderr),
|
|
129
|
+
handle.exitCode
|
|
130
|
+
], { concurrency: "unbounded" });
|
|
131
|
+
if (Number(code) !== SUCCESS) return yield* Effect.fail(`claude exited with ${String(code)}: ${pipe(stderr, String$1.trim, String$1.takeRight(STDERR_TAIL))}`);
|
|
132
|
+
return stdout;
|
|
133
|
+
});
|
|
134
|
+
const verdictOf = (target, answer) => {
|
|
135
|
+
if (answer.verdict === "pass") return { status: "pass" };
|
|
136
|
+
if (answer.verdict === "unknown") return unknownBecause(answer.reason);
|
|
137
|
+
return Option.match(lineOfQuote({
|
|
138
|
+
text: target.text,
|
|
139
|
+
quote: answer.quote
|
|
140
|
+
}), {
|
|
141
|
+
onNone: () => unknownBecause("the quoted text is not in the target file"),
|
|
142
|
+
onSome: (line) => ({
|
|
143
|
+
status: "violation",
|
|
144
|
+
line,
|
|
145
|
+
quote: answer.quote,
|
|
146
|
+
reason: answer.reason
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
const judgeIn = Effect.fn("agentJudge")(function* judgeIn(setup, input) {
|
|
151
|
+
const directory = yield* sandboxOf([input.target, ...input.context]);
|
|
152
|
+
const schema = yield* encodeJson$1(AGENT_SCHEMA);
|
|
153
|
+
const stdout = yield* runClaude(setup, {
|
|
154
|
+
directory,
|
|
155
|
+
args: argsOf(input, schema)
|
|
156
|
+
});
|
|
157
|
+
const result = yield* decodeResult(stdout);
|
|
158
|
+
const answer = Option.fromUndefinedOr(result.structured_output);
|
|
159
|
+
if (result.is_error || Option.isNone(answer)) return unknownBecause("claude returned no structured answer");
|
|
160
|
+
return verdictOf(input.target, answer.value);
|
|
161
|
+
});
|
|
162
|
+
const reasonOf = (failure) => {
|
|
163
|
+
if (typeof failure === "string") return failure;
|
|
164
|
+
if (failure instanceof Error) return failure.message;
|
|
165
|
+
return String(failure);
|
|
166
|
+
};
|
|
167
|
+
/** @internal */
|
|
168
|
+
const agentJudge = (setup) => ({
|
|
169
|
+
identity: {
|
|
170
|
+
model: AGENT_MODEL,
|
|
171
|
+
promptVersion: 1
|
|
172
|
+
},
|
|
173
|
+
judge: (input) => judgeIn(setup, input).pipe(Effect.scoped, Effect.timeout(AGENT_TIMEOUT), Effect.match({
|
|
174
|
+
onSuccess: (verdict) => verdict,
|
|
175
|
+
onFailure: (failure) => unknownBecause(reasonOf(failure))
|
|
176
|
+
}))
|
|
177
|
+
});
|
|
178
|
+
// src/features/judge-documents/model/decision-judge.ts
|
|
179
|
+
const ANSWERED_YES = "The decision model answered yes.";
|
|
180
|
+
const judgeDecision = ({ rule, target: { text } }) => Effect.sync(() => {
|
|
181
|
+
const judged = judgeText({
|
|
182
|
+
rule: {
|
|
183
|
+
id: rule.id,
|
|
184
|
+
question: rule.question,
|
|
185
|
+
cutoff: rule.cutoff
|
|
186
|
+
},
|
|
187
|
+
text,
|
|
188
|
+
model: DECISION_MODEL,
|
|
189
|
+
timeoutMs: DECISION_TIMEOUT_MS,
|
|
190
|
+
env: {}
|
|
191
|
+
});
|
|
192
|
+
if (judged.status === "violation") return {
|
|
193
|
+
status: "violation",
|
|
194
|
+
line: judged.line,
|
|
195
|
+
quote: textOfLine({
|
|
196
|
+
text,
|
|
197
|
+
line: judged.line
|
|
198
|
+
}),
|
|
199
|
+
reason: ANSWERED_YES
|
|
200
|
+
};
|
|
201
|
+
if (judged.status === "pass") return { status: "pass" };
|
|
202
|
+
return unknownBecause(judged.reason);
|
|
203
|
+
});
|
|
204
|
+
/** @internal */
|
|
205
|
+
const DECISION_JUDGE = {
|
|
206
|
+
identity: {
|
|
207
|
+
model: DECISION_MODEL,
|
|
208
|
+
promptVersion: 1
|
|
209
|
+
},
|
|
210
|
+
judge: judgeDecision
|
|
211
|
+
};
|
|
212
|
+
// src/features/judge-documents/model/judge-rules.ts
|
|
213
|
+
const DECISION_CUTOFF = .8;
|
|
214
|
+
/** @internal */
|
|
215
|
+
const JUDGE_RULES = [
|
|
216
|
+
{
|
|
217
|
+
kind: "decision",
|
|
218
|
+
id: "agents-no-task-record",
|
|
219
|
+
files: ["**/AGENTS.md"],
|
|
220
|
+
question: "Does this document record finished work, such as a changelog, a dated list of completed tasks or the history of what was changed and why, instead of rules and facts that stay true? Answer no for standing rules, commands and structure, even when a rule names a date or gives the reason it exists.",
|
|
221
|
+
message: "Do not add a record of finished work to AGENTS.md. Put the reason for a change in its commit message.",
|
|
222
|
+
cutoff: DECISION_CUTOFF
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
kind: "decision",
|
|
226
|
+
id: "readme-no-code-restatement",
|
|
227
|
+
files: ["**/README.md"],
|
|
228
|
+
question: "Does this README list what the code already shows, such as every file, module, exported function, parameter, option or endpoint, instead of saying what the project is, how to start using it and where it is published? Answer no for a short table of entry points that a reader needs before opening the code, and for install and usage commands.",
|
|
229
|
+
message: "Do not copy what the code shows into the README. Say what it is, how to start using it and where it is published, and leave parameters, options and file lists to the types and the code.",
|
|
230
|
+
cutoff: DECISION_CUTOFF
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
kind: "agent",
|
|
234
|
+
id: "skill-restates-skill",
|
|
235
|
+
files: ["**/skills/*/SKILL.md"],
|
|
236
|
+
context: ["../*/SKILL.md", "./**/*.md"],
|
|
237
|
+
question: "Does this skill state a rule that another skill among the readable files also states in substance, so that two copies of one rule can drift apart? Answer no when the two rules differ in scope or reason, and when this skill only points to the other one.",
|
|
238
|
+
message: "Keep each rule in one skill. Replace the copy with a pointer to the skill that owns the rule, or move the rule to where both can follow it."
|
|
239
|
+
}
|
|
240
|
+
];
|
|
241
|
+
// src/features/judge-documents/model/judge-cache.ts
|
|
242
|
+
const encodeJson = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
|
|
243
|
+
const decodeCached = Schema.decodeUnknownOption(Schema.fromJsonString(DecidedVerdictSchema));
|
|
244
|
+
const encodeCached = Schema.encodeEffect(Schema.fromJsonString(DecidedVerdictSchema));
|
|
245
|
+
const ruleKey = ({ rule }) => {
|
|
246
|
+
if (rule.kind === "decision") return {
|
|
247
|
+
kind: rule.kind,
|
|
248
|
+
id: rule.id,
|
|
249
|
+
question: rule.question,
|
|
250
|
+
cutoff: rule.cutoff
|
|
251
|
+
};
|
|
252
|
+
return {
|
|
253
|
+
kind: rule.kind,
|
|
254
|
+
id: rule.id,
|
|
255
|
+
question: rule.question,
|
|
256
|
+
context: rule.context
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
/** @internal */
|
|
260
|
+
const cacheKeyOf = Effect.fn("cacheKeyOf")(function* cacheKeyOf(input, identity) {
|
|
261
|
+
const files = yield* RepositoryFiles;
|
|
262
|
+
const json = yield* encodeJson({
|
|
263
|
+
...identity,
|
|
264
|
+
rule: ruleKey(input),
|
|
265
|
+
target: input.target,
|
|
266
|
+
context: pipe(input.context, Array.map(({ name, text }) => [name, text]))
|
|
267
|
+
}).pipe(Effect.orDie);
|
|
268
|
+
return yield* files.hash(json);
|
|
269
|
+
});
|
|
270
|
+
const fileOf = (directory, key) => RepositoryFiles.pipe(Effect.map((files) => files.join(directory, `${key}.json`)));
|
|
271
|
+
/** @internal */
|
|
272
|
+
const readCached = Effect.fn("readCached")(function* readCached(directory, key) {
|
|
273
|
+
const files = yield* RepositoryFiles;
|
|
274
|
+
const file = yield* fileOf(directory, key);
|
|
275
|
+
return (yield* files.readFile(file)).pipe(Option.flatMap(decodeCached));
|
|
276
|
+
});
|
|
277
|
+
/** @internal */
|
|
278
|
+
const writeCached = Effect.fn("writeCached")(function* writeCached(directory, { key, verdict }) {
|
|
279
|
+
if (!isDecided(verdict)) return;
|
|
280
|
+
const files = yield* RepositoryFiles;
|
|
281
|
+
const file = yield* fileOf(directory, key);
|
|
282
|
+
const text = yield* encodeCached(verdict).pipe(Effect.orDie);
|
|
283
|
+
yield* files.writeFile(file, text);
|
|
284
|
+
});
|
|
285
|
+
// src/features/judge-documents/model/judge-input.ts
|
|
286
|
+
/** @internal */
|
|
287
|
+
const isDecisionInput = (input) => input.rule.kind === "decision";
|
|
288
|
+
/** @internal */
|
|
289
|
+
const isAgentInput = (input) => input.rule.kind === "agent";
|
|
290
|
+
/** @internal */
|
|
291
|
+
const readJudgedFile = Effect.fn("readJudgedFile")(function* readJudgedFile(root, name) {
|
|
292
|
+
const files = yield* RepositoryFiles;
|
|
293
|
+
return (yield* files.readFile(files.join(root, name))).pipe(Option.map((found) => ({
|
|
294
|
+
name,
|
|
295
|
+
text: found
|
|
296
|
+
})));
|
|
297
|
+
});
|
|
298
|
+
/** @internal */
|
|
299
|
+
const readJudgedFiles = Effect.fn("readJudgedFiles")(function* readJudgedFiles(root, names) {
|
|
300
|
+
const read = yield* Effect.forEach(names, (name) => readJudgedFile(root, name), { concurrency: "unbounded" });
|
|
301
|
+
return pipe(read, Array.getSomes);
|
|
302
|
+
});
|
|
303
|
+
// src/features/judge-documents/model/judge-pairs.ts
|
|
304
|
+
const GLOB = ":(glob)";
|
|
305
|
+
const globsOf = (patterns) => pipe(patterns, Array.map((pattern) => `${GLOB}${pattern}`));
|
|
306
|
+
const contextNames = Effect.fn("contextNames")(function* contextNames(root, rule, name) {
|
|
307
|
+
if (rule.kind === "decision") return [];
|
|
308
|
+
const files = yield* RepositoryFiles;
|
|
309
|
+
const directory = files.dirname(name);
|
|
310
|
+
const listed = yield* Effect.forEach(rule.context, (pattern) => files.matchingFiles(root, globsOf([files.join(directory, pattern)])), { concurrency: "unbounded" });
|
|
311
|
+
return pipe(listed, Array.flatten, Array.filter((found) => found !== name), Array.dedupe, (names) => Array.sort(names, Order.String));
|
|
312
|
+
});
|
|
313
|
+
const inputOf = Effect.fn("inputOf")(function* inputOf(root, { rule, name }) {
|
|
314
|
+
const target = yield* readJudgedFile(root, name);
|
|
315
|
+
if (Option.isNone(target)) return Option.none();
|
|
316
|
+
const names = yield* contextNames(root, rule, name);
|
|
317
|
+
const context = yield* readJudgedFiles(root, names);
|
|
318
|
+
return Option.some({
|
|
319
|
+
rule,
|
|
320
|
+
target: target.value,
|
|
321
|
+
context
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
const inputsOf = Effect.fn("inputsOf")(function* inputsOf(root, rule) {
|
|
325
|
+
const names = yield* (yield* RepositoryFiles).matchingFiles(root, globsOf(rule.files));
|
|
326
|
+
const inputs = yield* Effect.forEach(names, (name) => inputOf(root, {
|
|
327
|
+
rule,
|
|
328
|
+
name
|
|
329
|
+
}), { concurrency: "unbounded" });
|
|
330
|
+
return Array.getSomes(inputs);
|
|
331
|
+
});
|
|
332
|
+
/** @internal */
|
|
333
|
+
const judgeInputs = Effect.fn("judgeInputs")(function* judgeInputs(root, rules) {
|
|
334
|
+
const perRule = yield* Effect.forEach(rules, (rule) => inputsOf(root, rule), { concurrency: "unbounded" });
|
|
335
|
+
return Array.flatten(perRule);
|
|
336
|
+
});
|
|
337
|
+
// src/features/judge-documents/model/judge-repository.ts
|
|
338
|
+
const AGENT_CONCURRENCY = 4;
|
|
339
|
+
const SEQUENTIAL = 1;
|
|
340
|
+
const FIRST_COLUMN = 1;
|
|
341
|
+
const QUOTE_START = 0;
|
|
342
|
+
const QUOTE_LIMIT = 160;
|
|
343
|
+
const WHITESPACE = /\s+/gu;
|
|
344
|
+
const oneLine = (text) => pipe(text, String$1.replaceAll(WHITESPACE, " "), String$1.trim, String$1.slice(QUOTE_START, QUOTE_LIMIT));
|
|
345
|
+
const cachedBy = (directory, judge) => (input) => Effect.gen(function* cached() {
|
|
346
|
+
const key = yield* cacheKeyOf(input, judge.identity);
|
|
347
|
+
const hit = yield* readCached(directory, key);
|
|
348
|
+
if (Option.isSome(hit)) return hit.value;
|
|
349
|
+
const verdict = yield* judge.judge(input);
|
|
350
|
+
yield* writeCached(directory, {
|
|
351
|
+
key,
|
|
352
|
+
verdict
|
|
353
|
+
});
|
|
354
|
+
return verdict;
|
|
355
|
+
});
|
|
356
|
+
const problemOf = (file, { input, verdict }) => {
|
|
357
|
+
const { rule } = input;
|
|
358
|
+
if (verdict.status === "pass") return Option.none();
|
|
359
|
+
if (verdict.status === "unknown") return Option.some(problemInFile("judge-unknown")(file, `Could not decide ${rule.id}. ${verdict.reason}`));
|
|
360
|
+
return Option.some(problemAtPosition(rule.id)(file, {
|
|
361
|
+
line: verdict.line,
|
|
362
|
+
column: FIRST_COLUMN
|
|
363
|
+
}, `${rule.message} ${verdict.reason} Quoted: ${oneLine(verdict.quote)}`));
|
|
364
|
+
};
|
|
365
|
+
/** @internal */
|
|
366
|
+
const judgeRepository = Effect.fn("judgeRepository")(function* judgeRepository(root, setup) {
|
|
367
|
+
const files = yield* RepositoryFiles;
|
|
368
|
+
const inputs = yield* judgeInputs(root, setup.rules);
|
|
369
|
+
const decisions = pipe(inputs, Array.filter(isDecisionInput));
|
|
370
|
+
const agents = pipe(inputs, Array.filter(isAgentInput));
|
|
371
|
+
const decided = yield* Effect.forEach(decisions, cachedBy(setup.cacheDirectory, setup.decision), { concurrency: SEQUENTIAL });
|
|
372
|
+
const reasoned = yield* Effect.forEach(agents, cachedBy(setup.cacheDirectory, setup.agent), { concurrency: AGENT_CONCURRENCY });
|
|
373
|
+
const answered = [...decisions, ...agents];
|
|
374
|
+
return pipe(Array.zip(answered, [...decided, ...reasoned]), Array.map(([input, verdict]) => problemOf(files.join(root, input.target.name), {
|
|
375
|
+
input,
|
|
376
|
+
verdict
|
|
377
|
+
})), Array.getSomes);
|
|
378
|
+
});
|
|
379
|
+
// bin/msch-judge.ts
|
|
380
|
+
const taggedError = Schema.TaggedError;
|
|
381
|
+
var UsageError = class extends taggedError()("UsageError", { message: Schema.String }) {};
|
|
382
|
+
const USAGE = `usage: msch-judge <cache directory> [${JSON_FLAG}]`;
|
|
383
|
+
const Arguments = Schema.Tuple([Schema.NonEmptyString]);
|
|
384
|
+
const cacheDirectoryOf = Effect.fn("cacheDirectoryOf")(function* cacheDirectoryOf(args) {
|
|
385
|
+
const positional = pipe(args, Array.filter((arg) => arg !== JSON_FLAG));
|
|
386
|
+
const [directory] = yield* Schema.decodeUnknownEffect(Arguments)(positional).pipe(Effect.mapError(() => UsageError.make({ message: USAGE })));
|
|
387
|
+
return directory;
|
|
388
|
+
});
|
|
389
|
+
const report = Effect.fn("report")(function* report(root, { problems, json }) {
|
|
390
|
+
if (json) return yield* writeJsonProblems(problems);
|
|
391
|
+
return yield* writeProblems(root)(problems);
|
|
392
|
+
});
|
|
393
|
+
const judge = Effect.gen(function* judge() {
|
|
394
|
+
const stdio = yield* Stdio.Stdio;
|
|
395
|
+
const files = yield* RepositoryFiles;
|
|
396
|
+
const args = yield* stdio.args;
|
|
397
|
+
const directory = yield* cacheDirectoryOf(args);
|
|
398
|
+
const root = files.resolve(".");
|
|
399
|
+
const found = yield* judgeRepository(root, {
|
|
400
|
+
cacheDirectory: files.resolve(directory),
|
|
401
|
+
rules: JUDGE_RULES,
|
|
402
|
+
decision: DECISION_JUDGE,
|
|
403
|
+
agent: agentJudge(CLAUDE)
|
|
404
|
+
});
|
|
405
|
+
const problems = sortProblems(found);
|
|
406
|
+
yield* report(root, {
|
|
407
|
+
problems,
|
|
408
|
+
json: Array.contains(args, JSON_FLAG)
|
|
409
|
+
});
|
|
410
|
+
return yield* failWhenAny(problems.length);
|
|
411
|
+
});
|
|
412
|
+
runCli("msch-judge")(judge);
|
|
413
|
+
export {};
|
|
414
|
+
|
|
415
|
+
//# sourceMappingURL=judge.mjs.map
|