lazycodex-ai 5.1.44 → 5.1.46
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.de.md +0 -5
- package/README.es.md +0 -5
- package/README.fr.md +0 -5
- package/README.it.md +0 -5
- package/README.ja.md +0 -5
- package/README.ko.md +0 -5
- package/README.md +4 -5
- package/README.pt-br.md +0 -5
- package/README.ru.md +0 -6
- package/README.zh-cn.md +0 -5
- package/dist/cli/index.js +865 -413
- package/dist/cli/service-auth/keystore.d.ts +4 -2
- package/dist/cli-node/index.js +865 -413
- package/docs/reference/web-terminal-visual-qa.md +8 -0
- package/package.json +1 -1
- package/packages/lsp-daemon/dist/cli.js +7 -7
- package/packages/lsp-daemon/dist/client.js +7 -7
- package/packages/lsp-daemon/dist/index.js +7 -7
- package/packages/lsp-daemon/package.json +3 -3
- package/packages/lsp-tools-mcp/dist/cli.js +7 -7
- package/packages/lsp-tools-mcp/dist/mcp.js +7 -7
- package/packages/lsp-tools-mcp/dist/tools.js +4 -4
- package/packages/lsp-tools-mcp/package.json +3 -3
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +77 -26
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/src/hook.ts +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/biome.json +1 -21
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +4 -4
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +1 -21
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +4 -4
- package/packages/omo-codex/plugin/components/lsp/biome.json +1 -21
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +4 -4
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +4 -4
- package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.mjs +0 -1
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-not-installed.test.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/biome.json +1 -21
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +4 -4
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/biome.json +1 -21
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +90 -1
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +91 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +4 -4
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/biome.json +1 -21
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/biome.json +1 -21
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/directive.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/biome.json +1 -21
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +7 -7
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-mutations.mjs +2 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +14 -9
- package/packages/omo-codex/plugin/skills/ast-grep/AGENTS.md +1 -1
- package/packages/omo-codex/plugin/skills/browser/SKILL.md +21 -22
- package/packages/omo-codex/plugin/skills/browser/references/commands.md +2 -9
- package/packages/omo-codex/plugin/skills/browser/references/install.md +1 -2
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/scripts/browser-doctor.mjs +2 -2
- package/packages/omo-codex/plugin/skills/browser/scripts/browser-engine-guard.mjs +63 -487
- package/packages/omo-codex/plugin/skills/browser/scripts/browser-install.mjs +1 -1
- package/packages/omo-codex/plugin/skills/browser/scripts/omowright.mjs +1 -10
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +2 -2
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +79 -118
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +75 -224
- package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +32 -27
- package/packages/omo-codex/plugin/skills/frontend/references/perfection/README.md +2 -2
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/check-accent-stripes.ts +8 -24
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/check-draft-guard.ts +40 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/collect-files.ts +53 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/draft-guard/findings.ts +16 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/draft-guard/lint.ts +38 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/draft-guard/rules.ts +69 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/draft-guard/text-nodes.ts +121 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/attr-lookalikes.tsx +10 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/bound-values.tsx +12 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/const-generics.tsx +3 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/generics.tsx +7 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/measured-stats.html +6 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/plain-copy.html +9 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/state-copy.html +11 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/attribute-edges.html +7 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/components.tsx +16 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/decorative-badge.vue +7 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/emoji-icons.tsx +9 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/jsx-edges.tsx +1 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/promo-copy.html +6 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/promo-copy.tsx +8 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/vanity-stats.html +5 -0
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/programming/SKILL.md +10 -7
- package/packages/omo-codex/plugin/skills/programming/references/typescript/README.md +10 -7
- package/packages/omo-codex/plugin/skills/programming/references/typescript/bootstrap.md +9 -23
- package/packages/omo-codex/plugin/skills/programming/references/typescript/oxc-lint.md +130 -0
- package/packages/omo-codex/plugin/skills/programming/references/typescript/tsconfig-strict.md +6 -62
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/check-no-excuse-rules.ts +12 -12
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/new-project.ts +20 -81
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/.oxfmtrc.json +9 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/.oxlintrc.json +46 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/LICENSE +21 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/index.js +10 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/no-em-dash-copy.js +28 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/require-suppression-reason.js +62 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/tsconfig.json +29 -0
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +14 -14
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/AGENTS.md +21 -3
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +37 -12
- package/packages/omo-codex/plugin/skills/ulw-research/references/deliverable-phase.md +77 -16
- package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger-grammar.md +134 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger.md +95 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/fidelity-claim-kinds.md +19 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/report-gates.md +68 -3
- package/packages/omo-codex/plugin/skills/ulw-research/references/report-visualization.md +2 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/unit-rules.md +157 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/claim-kinds.mjs +116 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/claims-index.mjs +125 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/cli-support.mjs +19 -5
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/contracts.mjs +89 -3
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-meaning.mjs +191 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-verify.mjs +164 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands.mjs +239 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-derive.mjs +66 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-expr.mjs +108 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-fill.mjs +194 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-ledger-kinds.mjs +250 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-ledger-schema.mjs +221 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-ledger.mjs +123 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-locate.mjs +231 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-pairs.mjs +187 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-recompute.mjs +89 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-binding.mjs +130 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-brief.mjs +150 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-claims.mjs +89 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-lexicon.mjs +145 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-records.mjs +163 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-state.mjs +64 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-trace.mjs +85 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-values.mjs +229 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-fidelity.mjs +113 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-static.mjs +29 -9
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-structure.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-text.mjs +1 -27
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-lite.mjs +2 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-markup.mjs +182 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/lexicon.mjs +47 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/md-lite.mjs +193 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/meaning-check.mjs +196 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/numerals.mjs +226 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/outcome.mjs +8 -8
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/particles-ko.mjs +108 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/placeholder.mjs +184 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-apply.mjs +115 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-diff.mjs +31 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-project.mjs +125 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-rules.mjs +170 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/rational.mjs +139 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools-commands.mjs +21 -10
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools.mjs +15 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/sentence-split.mjs +77 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-commands.mjs +140 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-snapshot.mjs +176 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/text-normalize.mjs +82 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/text-similarity.mjs +28 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-algebra.mjs +101 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-errors.mjs +23 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-metadata.mjs +31 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-pairs.mjs +72 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-precision.mjs +44 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-rules-shapes.mjs +64 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-rules.mjs +173 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/units.mjs +105 -0
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +71 -64
- package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +4 -1
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +19 -0
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +12 -8
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +169 -30
- package/packages/shared-skills/skills/ast-grep/AGENTS.md +1 -1
- package/packages/shared-skills/skills/browser/SKILL.md +21 -22
- package/packages/shared-skills/skills/browser/references/commands.md +2 -9
- package/packages/shared-skills/skills/browser/references/install.md +1 -2
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/shared-skills/skills/browser/scripts/browser-doctor.mjs +2 -2
- package/packages/shared-skills/skills/browser/scripts/browser-engine-guard.mjs +63 -487
- package/packages/shared-skills/skills/browser/scripts/browser-install.mjs +1 -1
- package/packages/shared-skills/skills/browser/scripts/omowright.mjs +1 -10
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +2 -2
- package/packages/shared-skills/skills/frontend/SKILL.md +79 -118
- package/packages/shared-skills/skills/frontend/references/design/README.md +75 -224
- package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +32 -27
- package/packages/shared-skills/skills/frontend/references/perfection/README.md +2 -2
- package/packages/shared-skills/skills/frontend/scripts/perfection/check-accent-stripes.ts +8 -24
- package/packages/shared-skills/skills/frontend/scripts/perfection/check-draft-guard.test.ts +101 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/check-draft-guard.ts +40 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/collect-files.test.ts +50 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/collect-files.ts +53 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/draft-guard/findings.ts +16 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/draft-guard/lint.ts +38 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/draft-guard/rules.ts +69 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/draft-guard/text-nodes.ts +121 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/attr-lookalikes.tsx +10 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/bound-values.tsx +12 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/const-generics.tsx +3 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/generics.tsx +7 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/measured-stats.html +6 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/plain-copy.html +9 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/state-copy.html +11 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/attribute-edges.html +7 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/components.tsx +16 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/decorative-badge.vue +7 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/emoji-icons.tsx +9 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/jsx-edges.tsx +1 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/promo-copy.html +6 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/promo-copy.tsx +8 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/vanity-stats.html +5 -0
- package/packages/shared-skills/skills/programming/SKILL.md +10 -7
- package/packages/shared-skills/skills/programming/references/typescript/README.md +10 -7
- package/packages/shared-skills/skills/programming/references/typescript/bootstrap.md +9 -23
- package/packages/shared-skills/skills/programming/references/typescript/oxc-lint.md +130 -0
- package/packages/shared-skills/skills/programming/references/typescript/tsconfig-strict.md +6 -62
- package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.ts +12 -12
- package/packages/shared-skills/skills/programming/scripts/typescript/new-project.test.ts +162 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/new-project.ts +20 -81
- package/packages/shared-skills/skills/programming/scripts/typescript/oxc/.oxfmtrc.json +9 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/oxc/.oxlintrc.json +46 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/LICENSE +21 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/index.js +10 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/no-em-dash-copy.js +28 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/require-suppression-reason.js +62 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/oxc/tsconfig.json +29 -0
- package/packages/shared-skills/skills/refactor/SKILL.md +13 -13
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +1 -1
- package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
- package/packages/shared-skills/skills/ulw-research/AGENTS.md +21 -3
- package/packages/shared-skills/skills/ulw-research/SKILL.md +37 -12
- package/packages/shared-skills/skills/ulw-research/references/deliverable-phase.md +77 -16
- package/packages/shared-skills/skills/ulw-research/references/fact-ledger-grammar.md +134 -0
- package/packages/shared-skills/skills/ulw-research/references/fact-ledger.md +95 -0
- package/packages/shared-skills/skills/ulw-research/references/fidelity-claim-kinds.md +19 -0
- package/packages/shared-skills/skills/ulw-research/references/report-gates.md +68 -3
- package/packages/shared-skills/skills/ulw-research/references/report-visualization.md +2 -0
- package/packages/shared-skills/skills/ulw-research/references/unit-rules.md +157 -0
- package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.mjs +116 -0
- package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.test.ts +193 -0
- package/packages/shared-skills/skills/ulw-research/scripts/claims-index.mjs +125 -0
- package/packages/shared-skills/skills/ulw-research/scripts/claims-index.test.ts +149 -0
- package/packages/shared-skills/skills/ulw-research/scripts/cli-support.mjs +19 -5
- package/packages/shared-skills/skills/ulw-research/scripts/cli-support.test.ts +13 -2
- package/packages/shared-skills/skills/ulw-research/scripts/contracts.mjs +89 -3
- package/packages/shared-skills/skills/ulw-research/scripts/contracts.test.ts +100 -12
- package/packages/shared-skills/skills/ulw-research/scripts/copy-returns.test.ts +183 -0
- package/packages/shared-skills/skills/ulw-research/scripts/delivery-barrier.test.ts +245 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-meaning.mjs +191 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-verify.mjs +164 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands.mjs +239 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.mjs +66 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.test.ts +375 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-expr.mjs +108 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-fill.mjs +194 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-fill.test.ts +221 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-grammar.test.ts +197 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.mjs +250 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.test.ts +156 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-legacy.test.ts +160 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-schema.mjs +221 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-schema.test.ts +43 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger.mjs +123 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger.test.ts +254 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-locate.mjs +231 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-locate.test.ts +118 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-pairs.mjs +187 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-pairs.test.ts +167 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-recompute.mjs +89 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-dimensions.test.ts +409 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-rules.test.ts +388 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-binding.mjs +130 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-binding.test.ts +81 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-brief.mjs +150 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-brief.test.ts +179 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-claims.mjs +89 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-lexicon.mjs +145 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-lexicon.test.ts +117 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-records.mjs +163 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-state.mjs +64 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-state.test.ts +46 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-trace.mjs +85 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-trace.test.ts +58 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.mjs +229 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.test.ts +270 -0
- package/packages/shared-skills/skills/ulw-research/scripts/gates-context.test.ts +64 -0
- package/packages/shared-skills/skills/ulw-research/scripts/gates-fidelity.mjs +113 -0
- package/packages/shared-skills/skills/ulw-research/scripts/gates-fidelity.test.ts +73 -0
- package/packages/shared-skills/skills/ulw-research/scripts/gates-static.mjs +29 -9
- package/packages/shared-skills/skills/ulw-research/scripts/gates-structure.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/gates-text.mjs +1 -27
- package/packages/shared-skills/skills/ulw-research/scripts/html-lite.mjs +2 -2
- package/packages/shared-skills/skills/ulw-research/scripts/html-markup.mjs +182 -0
- package/packages/shared-skills/skills/ulw-research/scripts/lexicon.mjs +47 -0
- package/packages/shared-skills/skills/ulw-research/scripts/lexicon.test.ts +57 -0
- package/packages/shared-skills/skills/ulw-research/scripts/md-lite.mjs +193 -0
- package/packages/shared-skills/skills/ulw-research/scripts/md-lite.test.ts +271 -0
- package/packages/shared-skills/skills/ulw-research/scripts/meaning-check.mjs +196 -0
- package/packages/shared-skills/skills/ulw-research/scripts/meaning-check.test.ts +228 -0
- package/packages/shared-skills/skills/ulw-research/scripts/numerals.mjs +226 -0
- package/packages/shared-skills/skills/ulw-research/scripts/numerals.test.ts +120 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome.mjs +8 -8
- package/packages/shared-skills/skills/ulw-research/scripts/outcome.test.ts +29 -0
- package/packages/shared-skills/skills/ulw-research/scripts/particles-ko.mjs +108 -0
- package/packages/shared-skills/skills/ulw-research/scripts/particles-ko.test.ts +86 -0
- package/packages/shared-skills/skills/ulw-research/scripts/placeholder.mjs +184 -0
- package/packages/shared-skills/skills/ulw-research/scripts/placeholder.test.ts +77 -0
- package/packages/shared-skills/skills/ulw-research/scripts/polish-apply.mjs +115 -0
- package/packages/shared-skills/skills/ulw-research/scripts/polish-apply.test.ts +363 -0
- package/packages/shared-skills/skills/ulw-research/scripts/polish-diff.mjs +31 -0
- package/packages/shared-skills/skills/ulw-research/scripts/polish-diff.test.ts +168 -0
- package/packages/shared-skills/skills/ulw-research/scripts/polish-markup.test.ts +187 -0
- package/packages/shared-skills/skills/ulw-research/scripts/polish-project.mjs +125 -0
- package/packages/shared-skills/skills/ulw-research/scripts/polish-rules.mjs +170 -0
- package/packages/shared-skills/skills/ulw-research/scripts/rational.mjs +139 -0
- package/packages/shared-skills/skills/ulw-research/scripts/rational.test.ts +46 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-commands.mjs +21 -10
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools.mjs +15 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools.test.ts +458 -2
- package/packages/shared-skills/skills/ulw-research/scripts/sentence-split.mjs +77 -0
- package/packages/shared-skills/skills/ulw-research/scripts/sentence-split.test.ts +109 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-commands.mjs +140 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.mjs +176 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.test.ts +113 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/assets/share.csv +3 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/claim-graph.md +13 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/gen-legacy-dev.mjs +89 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/ledger-basic.json +223 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/ledger-legacy-dev.json +859 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/ledger-verify.json +420 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/report-bad.html +19 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/report-good.html +39 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4/acronyms.json +3 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4/meta.json +9 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4/sentences.jsonl +7 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4/text.txt +7 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4.html +19 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S5/acronyms.json +1 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S5/meta.json +9 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S5/sentences.jsonl +1 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S5/text.txt +1 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S9.txt +1 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity-brief-locked.md +17 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity-brief-pending.md +17 -0
- package/packages/shared-skills/skills/ulw-research/scripts/text-normalize.mjs +82 -0
- package/packages/shared-skills/skills/ulw-research/scripts/text-normalize.test.ts +73 -0
- package/packages/shared-skills/skills/ulw-research/scripts/text-similarity.mjs +28 -0
- package/packages/shared-skills/skills/ulw-research/scripts/text-similarity.test.ts +38 -0
- package/packages/shared-skills/skills/ulw-research/scripts/unit-algebra.mjs +101 -0
- package/packages/shared-skills/skills/ulw-research/scripts/unit-errors.mjs +23 -0
- package/packages/shared-skills/skills/ulw-research/scripts/unit-metadata.mjs +31 -0
- package/packages/shared-skills/skills/ulw-research/scripts/unit-pairs.mjs +72 -0
- package/packages/shared-skills/skills/ulw-research/scripts/unit-precision.mjs +44 -0
- package/packages/shared-skills/skills/ulw-research/scripts/unit-rules-shapes.mjs +64 -0
- package/packages/shared-skills/skills/ulw-research/scripts/unit-rules.mjs +173 -0
- package/packages/shared-skills/skills/ulw-research/scripts/units.mjs +105 -0
- package/packages/shared-skills/skills/ulw-research/scripts/units.test.ts +83 -0
- package/packages/shared-skills/skills/visual-qa/SKILL.md +70 -63
- package/packages/shared-skills/skills/visual-qa/scripts/skill-doc-fields.test.ts +34 -0
- package/script/qa/web-terminal-visual-qa.mjs +6 -2
- package/script/qa/xterm-live-terminal.mjs +26 -3
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"rows": [
|
|
4
|
+
{
|
|
5
|
+
"fact_id": "F1",
|
|
6
|
+
"kind": "measured",
|
|
7
|
+
"raw": "320 m",
|
|
8
|
+
"quote": "The bridge span is up to 320 m long.",
|
|
9
|
+
"extracted_by": "tool:source-snapshot@1",
|
|
10
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
11
|
+
"label": "span_len",
|
|
12
|
+
"value": "320",
|
|
13
|
+
"unit": "m",
|
|
14
|
+
"value_span": [
|
|
15
|
+
25,
|
|
16
|
+
30
|
|
17
|
+
],
|
|
18
|
+
"source_id": "S4",
|
|
19
|
+
"locator": {
|
|
20
|
+
"artifact": "text.txt",
|
|
21
|
+
"char_start": 0,
|
|
22
|
+
"char_end": 36
|
|
23
|
+
},
|
|
24
|
+
"locate_hint": null,
|
|
25
|
+
"snapshot_sha256": "89abfafc79d0e2c13a5ccad6843c020dc65e86f1eca385f85e7f58153960cdfe",
|
|
26
|
+
"valid_at": "2026",
|
|
27
|
+
"qualifier": "upper_inclusive",
|
|
28
|
+
"entity": "Bridge",
|
|
29
|
+
"sentence_id": "S4:s1",
|
|
30
|
+
"observation_id": "O1",
|
|
31
|
+
"fuzzy": false,
|
|
32
|
+
"outside_floor": false,
|
|
33
|
+
"population": null,
|
|
34
|
+
"missing_rule": null,
|
|
35
|
+
"accounting_basis": null,
|
|
36
|
+
"snapshot_window": null,
|
|
37
|
+
"revision": null,
|
|
38
|
+
"exact": {
|
|
39
|
+
"num": "320",
|
|
40
|
+
"den": "1"
|
|
41
|
+
},
|
|
42
|
+
"render": null,
|
|
43
|
+
"operation": null,
|
|
44
|
+
"operands": [],
|
|
45
|
+
"derived_from": [],
|
|
46
|
+
"formula": null,
|
|
47
|
+
"factor": null,
|
|
48
|
+
"rationale": null,
|
|
49
|
+
"status": "active"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"fact_id": "F2",
|
|
53
|
+
"kind": "measured",
|
|
54
|
+
"raw": "1,237",
|
|
55
|
+
"quote": "Units sold reached 1,237 in 2026.",
|
|
56
|
+
"extracted_by": "tool:source-snapshot@1",
|
|
57
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
58
|
+
"label": "units_sold",
|
|
59
|
+
"value": "1237",
|
|
60
|
+
"unit": null,
|
|
61
|
+
"value_span": [
|
|
62
|
+
19,
|
|
63
|
+
24
|
|
64
|
+
],
|
|
65
|
+
"source_id": "S4",
|
|
66
|
+
"locator": {
|
|
67
|
+
"artifact": "text.txt",
|
|
68
|
+
"char_start": 37,
|
|
69
|
+
"char_end": 70
|
|
70
|
+
},
|
|
71
|
+
"locate_hint": null,
|
|
72
|
+
"snapshot_sha256": "89abfafc79d0e2c13a5ccad6843c020dc65e86f1eca385f85e7f58153960cdfe",
|
|
73
|
+
"valid_at": "2026",
|
|
74
|
+
"qualifier": null,
|
|
75
|
+
"entity": null,
|
|
76
|
+
"sentence_id": "S4:s2",
|
|
77
|
+
"observation_id": "O1",
|
|
78
|
+
"fuzzy": false,
|
|
79
|
+
"outside_floor": false,
|
|
80
|
+
"population": null,
|
|
81
|
+
"missing_rule": null,
|
|
82
|
+
"accounting_basis": null,
|
|
83
|
+
"snapshot_window": null,
|
|
84
|
+
"revision": null,
|
|
85
|
+
"exact": {
|
|
86
|
+
"num": "1237",
|
|
87
|
+
"den": "1"
|
|
88
|
+
},
|
|
89
|
+
"render": null,
|
|
90
|
+
"operation": null,
|
|
91
|
+
"operands": [],
|
|
92
|
+
"derived_from": [],
|
|
93
|
+
"formula": null,
|
|
94
|
+
"factor": null,
|
|
95
|
+
"rationale": null,
|
|
96
|
+
"status": "active"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"fact_id": "F3",
|
|
100
|
+
"kind": "measured",
|
|
101
|
+
"raw": "12%",
|
|
102
|
+
"quote": "Revenue grew 12% year over year.",
|
|
103
|
+
"extracted_by": "tool:source-snapshot@1",
|
|
104
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
105
|
+
"label": "rate_yoy",
|
|
106
|
+
"value": "12",
|
|
107
|
+
"unit": "%",
|
|
108
|
+
"value_span": [
|
|
109
|
+
13,
|
|
110
|
+
16
|
|
111
|
+
],
|
|
112
|
+
"source_id": "S4",
|
|
113
|
+
"locator": {
|
|
114
|
+
"artifact": "text.txt",
|
|
115
|
+
"char_start": 71,
|
|
116
|
+
"char_end": 103
|
|
117
|
+
},
|
|
118
|
+
"locate_hint": null,
|
|
119
|
+
"snapshot_sha256": "89abfafc79d0e2c13a5ccad6843c020dc65e86f1eca385f85e7f58153960cdfe",
|
|
120
|
+
"valid_at": "2026 YoY",
|
|
121
|
+
"qualifier": null,
|
|
122
|
+
"entity": null,
|
|
123
|
+
"sentence_id": "S4:s3",
|
|
124
|
+
"observation_id": "O2",
|
|
125
|
+
"fuzzy": false,
|
|
126
|
+
"outside_floor": false,
|
|
127
|
+
"population": null,
|
|
128
|
+
"missing_rule": null,
|
|
129
|
+
"accounting_basis": null,
|
|
130
|
+
"snapshot_window": null,
|
|
131
|
+
"revision": null,
|
|
132
|
+
"exact": {
|
|
133
|
+
"num": "12",
|
|
134
|
+
"den": "1"
|
|
135
|
+
},
|
|
136
|
+
"render": null,
|
|
137
|
+
"operation": null,
|
|
138
|
+
"operands": [],
|
|
139
|
+
"derived_from": [],
|
|
140
|
+
"formula": null,
|
|
141
|
+
"factor": null,
|
|
142
|
+
"rationale": null,
|
|
143
|
+
"status": "active"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"fact_id": "F4",
|
|
147
|
+
"kind": "measured",
|
|
148
|
+
"raw": "12%",
|
|
149
|
+
"quote": "Revenue grew 12% quarter over quarter.",
|
|
150
|
+
"extracted_by": "tool:source-snapshot@1",
|
|
151
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
152
|
+
"label": "rate_qoq",
|
|
153
|
+
"value": "12",
|
|
154
|
+
"unit": "%",
|
|
155
|
+
"value_span": [
|
|
156
|
+
13,
|
|
157
|
+
16
|
|
158
|
+
],
|
|
159
|
+
"source_id": "S4",
|
|
160
|
+
"locator": {
|
|
161
|
+
"artifact": "text.txt",
|
|
162
|
+
"char_start": 104,
|
|
163
|
+
"char_end": 142
|
|
164
|
+
},
|
|
165
|
+
"locate_hint": null,
|
|
166
|
+
"snapshot_sha256": "89abfafc79d0e2c13a5ccad6843c020dc65e86f1eca385f85e7f58153960cdfe",
|
|
167
|
+
"valid_at": "2026 Q3 QoQ",
|
|
168
|
+
"qualifier": null,
|
|
169
|
+
"entity": null,
|
|
170
|
+
"sentence_id": "S4:s4",
|
|
171
|
+
"observation_id": "O3",
|
|
172
|
+
"fuzzy": false,
|
|
173
|
+
"outside_floor": false,
|
|
174
|
+
"population": null,
|
|
175
|
+
"missing_rule": null,
|
|
176
|
+
"accounting_basis": null,
|
|
177
|
+
"snapshot_window": null,
|
|
178
|
+
"revision": null,
|
|
179
|
+
"exact": {
|
|
180
|
+
"num": "12",
|
|
181
|
+
"den": "1"
|
|
182
|
+
},
|
|
183
|
+
"render": null,
|
|
184
|
+
"operation": null,
|
|
185
|
+
"operands": [],
|
|
186
|
+
"derived_from": [],
|
|
187
|
+
"formula": null,
|
|
188
|
+
"factor": null,
|
|
189
|
+
"rationale": null,
|
|
190
|
+
"status": "active"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"fact_id": "F5",
|
|
194
|
+
"kind": "measured",
|
|
195
|
+
"raw": "12%",
|
|
196
|
+
"quote": "Segment A held 12% of the market and segment B held 27%.",
|
|
197
|
+
"extracted_by": "tool:source-snapshot@1",
|
|
198
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
199
|
+
"label": "seg_a",
|
|
200
|
+
"value": "12",
|
|
201
|
+
"unit": "%",
|
|
202
|
+
"value_span": [
|
|
203
|
+
15,
|
|
204
|
+
18
|
|
205
|
+
],
|
|
206
|
+
"source_id": "S4",
|
|
207
|
+
"locator": {
|
|
208
|
+
"artifact": "text.txt",
|
|
209
|
+
"char_start": 143,
|
|
210
|
+
"char_end": 199
|
|
211
|
+
},
|
|
212
|
+
"locate_hint": null,
|
|
213
|
+
"snapshot_sha256": "89abfafc79d0e2c13a5ccad6843c020dc65e86f1eca385f85e7f58153960cdfe",
|
|
214
|
+
"valid_at": null,
|
|
215
|
+
"qualifier": null,
|
|
216
|
+
"entity": null,
|
|
217
|
+
"sentence_id": "S4:s5",
|
|
218
|
+
"observation_id": null,
|
|
219
|
+
"fuzzy": false,
|
|
220
|
+
"outside_floor": false,
|
|
221
|
+
"population": null,
|
|
222
|
+
"missing_rule": null,
|
|
223
|
+
"accounting_basis": null,
|
|
224
|
+
"snapshot_window": null,
|
|
225
|
+
"revision": null,
|
|
226
|
+
"exact": {
|
|
227
|
+
"num": "12",
|
|
228
|
+
"den": "1"
|
|
229
|
+
},
|
|
230
|
+
"render": null,
|
|
231
|
+
"operation": null,
|
|
232
|
+
"operands": [],
|
|
233
|
+
"derived_from": [],
|
|
234
|
+
"formula": null,
|
|
235
|
+
"factor": null,
|
|
236
|
+
"rationale": null,
|
|
237
|
+
"status": "active"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"fact_id": "F6",
|
|
241
|
+
"kind": "measured",
|
|
242
|
+
"raw": "27%",
|
|
243
|
+
"quote": "Segment A held 12% of the market and segment B held 27%.",
|
|
244
|
+
"extracted_by": "tool:source-snapshot@1",
|
|
245
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
246
|
+
"label": "seg_b",
|
|
247
|
+
"value": "27",
|
|
248
|
+
"unit": "%",
|
|
249
|
+
"value_span": [
|
|
250
|
+
52,
|
|
251
|
+
55
|
|
252
|
+
],
|
|
253
|
+
"source_id": "S4",
|
|
254
|
+
"locator": {
|
|
255
|
+
"artifact": "text.txt",
|
|
256
|
+
"char_start": 143,
|
|
257
|
+
"char_end": 199
|
|
258
|
+
},
|
|
259
|
+
"locate_hint": null,
|
|
260
|
+
"snapshot_sha256": "89abfafc79d0e2c13a5ccad6843c020dc65e86f1eca385f85e7f58153960cdfe",
|
|
261
|
+
"valid_at": null,
|
|
262
|
+
"qualifier": null,
|
|
263
|
+
"entity": null,
|
|
264
|
+
"sentence_id": "S4:s5",
|
|
265
|
+
"observation_id": null,
|
|
266
|
+
"fuzzy": false,
|
|
267
|
+
"outside_floor": false,
|
|
268
|
+
"population": null,
|
|
269
|
+
"missing_rule": null,
|
|
270
|
+
"accounting_basis": null,
|
|
271
|
+
"snapshot_window": null,
|
|
272
|
+
"revision": null,
|
|
273
|
+
"exact": {
|
|
274
|
+
"num": "27",
|
|
275
|
+
"den": "1"
|
|
276
|
+
},
|
|
277
|
+
"render": null,
|
|
278
|
+
"operation": null,
|
|
279
|
+
"operands": [],
|
|
280
|
+
"derived_from": [],
|
|
281
|
+
"formula": null,
|
|
282
|
+
"factor": null,
|
|
283
|
+
"rationale": null,
|
|
284
|
+
"status": "active"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"fact_id": "F7",
|
|
288
|
+
"kind": "measured",
|
|
289
|
+
"raw": "42 passed",
|
|
290
|
+
"quote": "42 passed",
|
|
291
|
+
"extracted_by": "tool:source-snapshot@1",
|
|
292
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
293
|
+
"label": "test_pass",
|
|
294
|
+
"value": "42",
|
|
295
|
+
"unit": null,
|
|
296
|
+
"value_span": [
|
|
297
|
+
0,
|
|
298
|
+
9
|
|
299
|
+
],
|
|
300
|
+
"source_id": "S5",
|
|
301
|
+
"locator": {
|
|
302
|
+
"artifact": "text.txt",
|
|
303
|
+
"char_start": 0,
|
|
304
|
+
"char_end": 9
|
|
305
|
+
},
|
|
306
|
+
"locate_hint": null,
|
|
307
|
+
"snapshot_sha256": "e6d47cc01ac7d20e7ba7acd6d1ad113573c1991f02c5af5f0f64a0572e0607f1",
|
|
308
|
+
"valid_at": null,
|
|
309
|
+
"qualifier": null,
|
|
310
|
+
"entity": null,
|
|
311
|
+
"sentence_id": "S5:s1",
|
|
312
|
+
"observation_id": null,
|
|
313
|
+
"fuzzy": false,
|
|
314
|
+
"outside_floor": false,
|
|
315
|
+
"population": null,
|
|
316
|
+
"missing_rule": null,
|
|
317
|
+
"accounting_basis": null,
|
|
318
|
+
"snapshot_window": null,
|
|
319
|
+
"revision": null,
|
|
320
|
+
"exact": {
|
|
321
|
+
"num": "42",
|
|
322
|
+
"den": "1"
|
|
323
|
+
},
|
|
324
|
+
"render": null,
|
|
325
|
+
"operation": null,
|
|
326
|
+
"operands": [],
|
|
327
|
+
"derived_from": [],
|
|
328
|
+
"formula": null,
|
|
329
|
+
"factor": null,
|
|
330
|
+
"rationale": null,
|
|
331
|
+
"status": "active"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"fact_id": "Q1",
|
|
335
|
+
"kind": "quote",
|
|
336
|
+
"raw": "we estimate completion no earlier than 2027",
|
|
337
|
+
"quote": "we estimate completion no earlier than 2027",
|
|
338
|
+
"extracted_by": "tool:source-snapshot@1",
|
|
339
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
340
|
+
"label": "completion",
|
|
341
|
+
"value": null,
|
|
342
|
+
"unit": null,
|
|
343
|
+
"value_span": null,
|
|
344
|
+
"source_id": "S4",
|
|
345
|
+
"locator": {
|
|
346
|
+
"artifact": "text.txt",
|
|
347
|
+
"char_start": 215,
|
|
348
|
+
"char_end": 258
|
|
349
|
+
},
|
|
350
|
+
"locate_hint": null,
|
|
351
|
+
"snapshot_sha256": "89abfafc79d0e2c13a5ccad6843c020dc65e86f1eca385f85e7f58153960cdfe",
|
|
352
|
+
"valid_at": null,
|
|
353
|
+
"qualifier": null,
|
|
354
|
+
"entity": "Operator",
|
|
355
|
+
"sentence_id": "S4:s6",
|
|
356
|
+
"observation_id": null,
|
|
357
|
+
"fuzzy": false,
|
|
358
|
+
"outside_floor": false,
|
|
359
|
+
"population": null,
|
|
360
|
+
"missing_rule": null,
|
|
361
|
+
"accounting_basis": null,
|
|
362
|
+
"snapshot_window": null,
|
|
363
|
+
"revision": null,
|
|
364
|
+
"exact": null,
|
|
365
|
+
"render": null,
|
|
366
|
+
"operation": null,
|
|
367
|
+
"operands": [],
|
|
368
|
+
"derived_from": [],
|
|
369
|
+
"formula": null,
|
|
370
|
+
"factor": null,
|
|
371
|
+
"rationale": null,
|
|
372
|
+
"status": "active"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"fact_id": "F8",
|
|
376
|
+
"kind": "converted",
|
|
377
|
+
"raw": "320 m",
|
|
378
|
+
"quote": "",
|
|
379
|
+
"extracted_by": "tool:source-snapshot@1",
|
|
380
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
381
|
+
"label": "span_mm",
|
|
382
|
+
"value": "320000",
|
|
383
|
+
"unit": "mm",
|
|
384
|
+
"value_span": null,
|
|
385
|
+
"source_id": null,
|
|
386
|
+
"locator": null,
|
|
387
|
+
"locate_hint": null,
|
|
388
|
+
"snapshot_sha256": null,
|
|
389
|
+
"valid_at": null,
|
|
390
|
+
"qualifier": null,
|
|
391
|
+
"entity": null,
|
|
392
|
+
"sentence_id": null,
|
|
393
|
+
"observation_id": null,
|
|
394
|
+
"fuzzy": false,
|
|
395
|
+
"outside_floor": false,
|
|
396
|
+
"population": null,
|
|
397
|
+
"missing_rule": null,
|
|
398
|
+
"accounting_basis": null,
|
|
399
|
+
"snapshot_window": null,
|
|
400
|
+
"revision": null,
|
|
401
|
+
"exact": {
|
|
402
|
+
"num": "320000",
|
|
403
|
+
"den": "1"
|
|
404
|
+
},
|
|
405
|
+
"render": "320,000 mm (320 m)",
|
|
406
|
+
"operation": "convert",
|
|
407
|
+
"operands": [
|
|
408
|
+
"F1"
|
|
409
|
+
],
|
|
410
|
+
"derived_from": [
|
|
411
|
+
"F1"
|
|
412
|
+
],
|
|
413
|
+
"formula": "F1 * 1000",
|
|
414
|
+
"factor": "1000",
|
|
415
|
+
"rationale": null,
|
|
416
|
+
"status": "active"
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
"events": []
|
|
420
|
+
}
|
package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/report-bad.html
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head><meta charset="utf-8"><title>Bridge report</title></head>
|
|
4
|
+
<body>
|
|
5
|
+
<h1>Bridge report</h1>
|
|
6
|
+
<h2>Findings</h2>
|
|
7
|
+
<p>Revenue grew 12% [S4].</p>
|
|
8
|
+
<p>The span is <data class="fact" value="320" data-fact="F1" data-unit="m" data-lineage="MEASURED">up to 320 mm</data> long [S4].</p>
|
|
9
|
+
<p>Units sold reached <data class="fact" value="1237" data-fact="F2" data-lineage="MEASURED">1,273</data> [S4].</p>
|
|
10
|
+
<p>The operator wrote <q data-fact="Q1" data-quote-sel="full">we estimate completion no earlier than 2028</q> [S4].</p>
|
|
11
|
+
<p>Next year brings {{F9:growth}} more traffic [S4].</p>
|
|
12
|
+
<p>The bridge is popular with tourists.</p>
|
|
13
|
+
<p data-claim="C99">The design is the safest in the region.</p>
|
|
14
|
+
<h2>Sources</h2>
|
|
15
|
+
<ol>
|
|
16
|
+
<li id="s4">[S4] Bridge authority page, retrieved 2026-10-01.</li>
|
|
17
|
+
</ol>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/report-good.html
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head><meta charset="utf-8"><title>Bridge report</title></head>
|
|
4
|
+
<body>
|
|
5
|
+
<h1>Bridge report</h1>
|
|
6
|
+
<h2>Findings</h2>
|
|
7
|
+
<p>The span is <data class="fact" value="320" data-fact="F1" data-unit="m" data-lineage="MEASURED">up to 320 m</data> long [S4].</p>
|
|
8
|
+
<p>In millimetres the span is <data class="fact" value="320000" data-fact="F8" data-unit="mm" data-lineage="DERIVED">320,000 mm (320 m)</data> [S4].</p>
|
|
9
|
+
<p>Units sold reached <data class="fact" value="1237" data-fact="F2" data-lineage="MEASURED">1,237</data> [S4].</p>
|
|
10
|
+
<p>The operator wrote <q data-fact="Q1" data-quote-sel="full">we estimate completion no earlier than 2027</q> [S4].</p>
|
|
11
|
+
<p>The schedule note opens with <q data-fact="Q1" data-quote-sel="lead=4">we estimate completion no…</q> [S4].</p>
|
|
12
|
+
<p>The opening date is <q data-fact="Q1" data-quote-sel="from=no earlier;to=2027">…no earlier than 2027</q> [S4].</p>
|
|
13
|
+
<p>The test suite ran with <data class="fact" value="42" data-fact="F7" data-claim-kind="verified" data-lineage="MEASURED">42 passed</data> [S5].</p>
|
|
14
|
+
<p data-kind="opinion">This looks like a sound plan.</p>
|
|
15
|
+
<p data-claim="C1">The design follows the published standard.</p>
|
|
16
|
+
<figure data-chart-source="assets/share.csv">
|
|
17
|
+
<svg viewBox="0 0 200 100" role="img"><g class="ticks" data-tick-step="10" data-tick-min="0" data-tick-max="30"><text x="0" y="90">0</text><text x="0" y="60">10</text><text x="0" y="30">20</text><text x="0" y="5">30</text></g><text x="40" y="50">12%</text><text x="120" y="20">27%</text></svg>
|
|
18
|
+
<figcaption>Market share by segment, in percent [S4].</figcaption>
|
|
19
|
+
</figure>
|
|
20
|
+
<table>
|
|
21
|
+
<thead><tr><th>Metric</th><th>Value</th></tr></thead>
|
|
22
|
+
<tbody>
|
|
23
|
+
<tr><td>Span</td><td><data class="fact" value="320" data-fact="F1" data-unit="m" data-lineage="MEASURED">320 m</data></td></tr>
|
|
24
|
+
<tr><td>Units sold</td><td><data class="fact" value="1237" data-fact="F2" data-lineage="MEASURED">1,237</data></td></tr>
|
|
25
|
+
</tbody>
|
|
26
|
+
</table>
|
|
27
|
+
<h2>Appendix</h2>
|
|
28
|
+
<p>Units sold in the base year were <data class="fact" value="1237" data-fact="F2" data-lineage="MEASURED">1,237</data> [S4].</p>
|
|
29
|
+
<h2>Gaps and contradictions</h2>
|
|
30
|
+
<p data-claim="C3">An early schedule claim was refuted.</p>
|
|
31
|
+
<h2>How this report was made</h2>
|
|
32
|
+
<p>Collected from the cited public page and one recorded test run [S4] [S5].</p>
|
|
33
|
+
<h2>Sources</h2>
|
|
34
|
+
<ol>
|
|
35
|
+
<li id="s4">[S4] Bridge authority page, retrieved 2026-10-01.</li>
|
|
36
|
+
<li id="s5">[S5] Test run output, recorded 2026-10-01.</li>
|
|
37
|
+
</ol>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source_id": "S4",
|
|
3
|
+
"url": "https://example.org/bridge",
|
|
4
|
+
"observed_at": "2026-10-01T00:00:00Z",
|
|
5
|
+
"sha256": "89abfafc79d0e2c13a5ccad6843c020dc65e86f1eca385f85e7f58153960cdfe",
|
|
6
|
+
"extractor": "tool:source-snapshot@1",
|
|
7
|
+
"revision": null,
|
|
8
|
+
"kind": "page"
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{"sid":"S4:s1","start":0,"end":36,"text":"The bridge span is up to 320 m long."}
|
|
2
|
+
{"sid":"S4:s2","start":37,"end":70,"text":"Units sold reached 1,237 in 2026."}
|
|
3
|
+
{"sid":"S4:s3","start":71,"end":103,"text":"Revenue grew 12% year over year."}
|
|
4
|
+
{"sid":"S4:s4","start":104,"end":142,"text":"Revenue grew 12% quarter over quarter."}
|
|
5
|
+
{"sid":"S4:s5","start":143,"end":199,"text":"Segment A held 12% of the market and segment B held 27%."}
|
|
6
|
+
{"sid":"S4:s6","start":200,"end":258,"text":"Operators said we estimate completion no earlier than 2027"}
|
|
7
|
+
{"sid":"S4:s7","start":259,"end":299,"text":"High Bandwidth Memory (HBM) demand rose."}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
The bridge span is up to 320 m long.
|
|
2
|
+
Units sold reached 1,237 in 2026.
|
|
3
|
+
Revenue grew 12% year over year.
|
|
4
|
+
Revenue grew 12% quarter over quarter.
|
|
5
|
+
Segment A held 12% of the market and segment B held 27%.
|
|
6
|
+
Operators said we estimate completion no earlier than 2027
|
|
7
|
+
High Bandwidth Memory (HBM) demand rose.
|
package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4.html
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head><title>Harbor Bridge progress note</title><style>p { margin: 0 }</style></head>
|
|
4
|
+
<body>
|
|
5
|
+
<h1>Harbor Bridge progress note</h1>
|
|
6
|
+
<p>Span length: 320 m</p>
|
|
7
|
+
<p>The deck uses High Bandwidth Memory (HBM) sensors for strain logging.</p>
|
|
8
|
+
<p>Main span cost: 12 million USD, and approach span cost: 4 million USD.</p>
|
|
9
|
+
<!-- internal draft comment -->
|
|
10
|
+
<p>After the delay, we estimate completion no earlier than 2027.</p>
|
|
11
|
+
<table id="dimensions">
|
|
12
|
+
<caption>Bridge dimensions</caption>
|
|
13
|
+
<tr><th>Metric</th><th>Length</th></tr>
|
|
14
|
+
<tr><td>Span</td><td>320 m</td></tr>
|
|
15
|
+
<tr><td>Approach</td><td>85 m</td></tr>
|
|
16
|
+
</table>
|
|
17
|
+
<script>console.log("not prose")</script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"sid":"S5:s1","start":0,"end":9,"text":"42 passed"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
42 passed
|
package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S9.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
북미 클라우드향 HBM3E 매출은 2026년 3분기 연결 기준 최대 4조 2,000억 원에 달할 것으로 전망된다.
|
package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity-brief-locked.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Brief
|
|
2
|
+
|
|
3
|
+
## Deliverable
|
|
4
|
+
format: pdf (answered_by: request)
|
|
5
|
+
|
|
6
|
+
## Fidelity
|
|
7
|
+
as of: latest at run start, 2026-10-23 (answered_by: default)
|
|
8
|
+
meaning check: on (answered_by: default)
|
|
9
|
+
source floor: standard (answered_by: default)
|
|
10
|
+
derived numbers: allowed (answered_by: user)
|
|
11
|
+
languages: report ko; sources ko, en; quotes original with translation beside (answered_by: default)
|
|
12
|
+
identifier classes: version strings, package names, commit ids (answered_by: default)
|
|
13
|
+
fallback: block-quote (answered_by: request)
|
|
14
|
+
asked: derived numbers
|
|
15
|
+
|
|
16
|
+
## Notes
|
|
17
|
+
free text that is not part of the block
|
package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity-brief-pending.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Brief
|
|
2
|
+
|
|
3
|
+
## Deliverable
|
|
4
|
+
format: pdf (answered_by: request)
|
|
5
|
+
|
|
6
|
+
## Fidelity
|
|
7
|
+
as of: latest at run start, 2026-10-23 (answered_by: default)
|
|
8
|
+
meaning check: on (answered_by: default)
|
|
9
|
+
source floor: standard (answered_by: default)
|
|
10
|
+
derived numbers: pending (answered_by: pending)
|
|
11
|
+
languages: report ko; sources ko, en; quotes original with translation beside (answered_by: default)
|
|
12
|
+
identifier classes: version strings, package names, commit ids (answered_by: default)
|
|
13
|
+
fallback: block-quote (answered_by: request)
|
|
14
|
+
asked: derived numbers
|
|
15
|
+
|
|
16
|
+
## Notes
|
|
17
|
+
free text that is not part of the block
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// text-normalize.mjs - text normalization and raw-offset matching for fidelity checks.
|
|
2
|
+
//
|
|
3
|
+
// normalizeText applies NFC, maps curly and CJK quote glyphs to straight quotes, collapses
|
|
4
|
+
// whitespace runs to one space, and trims. findNormalized matches a needle against the
|
|
5
|
+
// normalized haystack and returns offsets into the RAW haystack through an offset map built
|
|
6
|
+
// during normalization. Plain Node ESM, no dependencies.
|
|
7
|
+
|
|
8
|
+
const DOUBLE_QUOTES = new Set([
|
|
9
|
+
"\u201C", "\u201D", "\u201E", "\u201F", "\u00AB", "\u00BB", "\u300C", "\u300D", "\u300E", "\u300F",
|
|
10
|
+
"\u301D", "\u301E", "\u301F", "\uFF02", "\u2033",
|
|
11
|
+
])
|
|
12
|
+
const SINGLE_QUOTES = new Set(["\u2018", "\u2019", "\u201A", "\u201B", "\u2039", "\u203A", "\uFF07", "\u2032"])
|
|
13
|
+
// Combining marks and conjoining Hangul medial/final jamo attach to the preceding code point,
|
|
14
|
+
// so a decomposed syllable is normalized as one unit.
|
|
15
|
+
const JOINS_PREVIOUS = /^[\p{M}\u1160-\u11FF\uD7B0-\uD7FF]$/u
|
|
16
|
+
const WHITESPACE = /^\s+$/u
|
|
17
|
+
const TOKEN_SEPARATOR = /[^\p{L}\p{N}\p{M}]+/u
|
|
18
|
+
|
|
19
|
+
function mapQuote(ch) {
|
|
20
|
+
if (DOUBLE_QUOTES.has(ch)) return '"'
|
|
21
|
+
if (SINGLE_QUOTES.has(ch)) return "'"
|
|
22
|
+
return ch
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function clusters(raw) {
|
|
26
|
+
const out = []
|
|
27
|
+
let at = 0
|
|
28
|
+
for (const ch of raw) {
|
|
29
|
+
const last = out[out.length - 1]
|
|
30
|
+
if (last && JOINS_PREVIOUS.test(ch)) last[1] += ch.length
|
|
31
|
+
else out.push([at, at + ch.length])
|
|
32
|
+
at += ch.length
|
|
33
|
+
}
|
|
34
|
+
return out
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Returns { text, starts, ends }: text[k] came from raw.slice(starts[k], ends[k]).
|
|
38
|
+
function normalizeWithMap(raw) {
|
|
39
|
+
const source = String(raw ?? "")
|
|
40
|
+
let text = ""
|
|
41
|
+
const starts = []
|
|
42
|
+
const ends = []
|
|
43
|
+
for (const [start, end] of clusters(source)) {
|
|
44
|
+
const piece = Array.from(source.slice(start, end).normalize("NFC"), mapQuote).join("")
|
|
45
|
+
if (WHITESPACE.test(piece)) {
|
|
46
|
+
if (text !== "" && !text.endsWith(" ")) {
|
|
47
|
+
text += " "
|
|
48
|
+
starts.push(start)
|
|
49
|
+
ends.push(end)
|
|
50
|
+
}
|
|
51
|
+
continue
|
|
52
|
+
}
|
|
53
|
+
for (let k = 0; k < piece.length; k++) {
|
|
54
|
+
starts.push(start)
|
|
55
|
+
ends.push(end)
|
|
56
|
+
}
|
|
57
|
+
text += piece
|
|
58
|
+
}
|
|
59
|
+
if (text.endsWith(" ")) {
|
|
60
|
+
text = text.slice(0, -1)
|
|
61
|
+
starts.pop()
|
|
62
|
+
ends.pop()
|
|
63
|
+
}
|
|
64
|
+
return { text, starts, ends }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function normalizeText(s) {
|
|
68
|
+
return normalizeWithMap(s).text
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function tokenize(s) {
|
|
72
|
+
return normalizeText(s).split(TOKEN_SEPARATOR).filter((token) => token !== "")
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function findNormalized(hay, needle) {
|
|
76
|
+
const target = normalizeText(needle)
|
|
77
|
+
if (target === "") return null
|
|
78
|
+
const map = normalizeWithMap(hay)
|
|
79
|
+
const at = map.text.indexOf(target)
|
|
80
|
+
if (at === -1) return null
|
|
81
|
+
return { start: map.starts[at], end: map.ends[at + target.length - 1] }
|
|
82
|
+
}
|