### Configuration file example (driftwatch.config.ts) Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/usage.md Example config file using defineConfig. Shows how to add extra sources and adjust per-check severity. Unknown keys cause the run to fail. ```ts import { defineConfig } from 'driftwatch' export default defineConfig({ // Audit these too, beyond what discovery finds sources: ['docs/agent-notes.md'], // Per-check severity: 'error' | 'warning' | 'off' checks: { 'link/broken': 'warning', 'frontmatter/invalid': 'off', }, }) ``` -------------------------------- ### Running from source with pnpm Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/usage.md Install dependencies, build, and run the CLI from the dist directory. Requires Node 24+ and pnpm. ```bash pnpm install pnpm build node ./dist/cli.js [paths...] ``` -------------------------------- ### driftwatch pretty output example Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/output.md Example console output of the default pretty format, showing grouped findings by file with line numbers, a summary line, and a fixable count. Colour is disabled when NO_COLOR is set or stdout is not a TTY. ```console $ driftwatch CLAUDE.md ✗ 12 src/lib/auth.ts path does not exist → src/auth/index.ts? ✗ 34 pnpm run test:e2e script not in package.json 2 files · 5 problems (4 errors, 1 warning) · 340ms 3 fixable with --fix ``` -------------------------------- ### Example of pretty output Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/SPEC.md Example of the default 'pretty' output format. Shows problems grouped by file, ordered by line, with symbols ✗ for errors, ⚠ for warnings, and a summary line. The quoted fragment is truncated to 40 characters with …. ```text CLAUDE.md ✗ 12 src/lib/auth.ts path does not exist → src/auth/index.ts? ✗ 34 pnpm run test:e2e script not in package.json ⚠ 51 "we use Prisma as the ORM" not in dependencies 2 files · 5 problems (4 errors, 1 warning) · 340ms ``` -------------------------------- ### Run driftwatch via npx and see example output Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/BRIEF.md Shows the command to run driftwatch with no configuration and the resulting terminal output, which lists problems found in agent context files with counts and a summary line. ```bash $ npx @abr4xas/driftwatch CLAUDE.md ✗ 12 src/lib/auth.ts path does not exist → src/auth/index.ts? ✗ 34 pnpm run test:e2e script not in package.json ⚠ 51 "we use Prisma as the ORM" not in dependencies .claude/skills/deploy/SKILL.md ✗ 3 name: deployment does not match the directory (deploy) ✗ 18 ./scripts/release.sh path does not exist 2 files · 5 problems (4 errors, 1 warning) · 340ms ``` -------------------------------- ### driftwatch JSON output schema example Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/output.md Example JSON output of the --format json flag, showing the stable contract with version 1, root path, duration, summary counts, and a finding object with check, severity, file, line, column, and suggestion. ```jsonc { "version": 1, "root": "/abs/path/to/repo", "durationMs": 340, "summary": { "sources": 14, "claims": 212, "errors": 4, "warnings": 1, "fixable": 3 }, "findings": [ { "check": "path/missing", "severity": "error", "file": "CLAUDE.md", "line": 12, "column": 4, "endLine": 12, "endColumn": 19, "text": "src/lib/auth.ts", "message": "path does not exist", "suggestion": { "value": "src/auth/index.ts", "confidence": 0.86, "fixable": true } } ] } ``` -------------------------------- ### JSON output example Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/SPEC.md Example of the JSON output from driftwatch. The file field is relative to root, line and column are 1-indexed, and endLine accompanies endColumn for unambiguous spans. ```jsonc { "version": 1, "root": "/abs/path/to/repo", "durationMs": 340, "summary": { "sources": 14, "claims": 212, "errors": 4, "warnings": 1, "fixable": 3 }, "findings": [ { "check": "path/missing", "severity": "error", "file": "CLAUDE.md", "line": 12, "column": 4, "endColumn": 19, "text": "src/lib/auth.ts", "message": "path does not exist", "suggestion": { "value": "src/auth/index.ts", "confidence": 0.86, "fixable": true } } ] } ``` -------------------------------- ### Run driftwatch with npx Source: https://github.com/abr4xas/driftwatch/blob/master/README.md Run driftwatch without installing it globally. Requires Node 24 or newer. No configuration, API key, or network access is needed. ```bash npx @abr4xas/driftwatch ``` -------------------------------- ### Code Scanning with driftwatch SARIF upload Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/ci.md Code Scanning setup: driftwatch writes a SARIF file and exposes its path via the sarif-file output; the action does not upload it. Requires security-events: write and fail-on-drift: false so findings are not reported twice. ```yaml permissions: contents: read security-events: write steps: - uses: actions/checkout@v7 - uses: abr4xas/driftwatch@v0 id: drift with: sarif: true fail-on-drift: false - uses: github/codeql-action/upload-sarif@v4 with: sarif_file: ${{ steps.drift.outputs.sarif-file }} ``` -------------------------------- ### driftwatch CLI usage and options Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/SPEC.md Shows the full command-line usage and all available options for the driftwatch tool. Use with no arguments to audit the whole repo with default configuration. Options include --fix, --dry-run, --json, --format, --only, --skip, --strict, --no-tier2, --config, --no-config, --quiet, --watch, --init, --version, and --help. ```text driftwatch [paths...] [options] Options --fix Apply the unambiguous fixes --dry-run With --fix, show what it would change without writing --json JSON output on stdout (see §6) --format pretty | json | github | sarif (default: pretty) --only Only these checks (comma-separated, accepts a prefix: --only path) --skip Exclude these checks --strict Warnings count as errors for the exit code --no-tier2 Turn off every tier 2 check --config Explicit path to the config --no-config Ignore any config found --quiet Show problems only, no summary --watch Re-run whenever a source changes --init Write a commented driftwatch.config.ts --version, -v --help, -h ``` -------------------------------- ### Basic usage: npx and path arguments Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/usage.md Run Driftwatch on the whole repo with npx, or specify paths to audit only those. Requires Node 24 or newer. ```bash npx @abr4xas/driftwatch # audit the whole repo driftwatch docs/ AGENTS.md # only these paths ``` -------------------------------- ### Pipeline overview: discover → parse → extract → verify → report Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/ARCHITECTURE.md Shows the linear pipeline stages and their data boundaries. Each stage has a narrow data boundary, and no stage knows the next one. ```text discover → parse → extract → verify → report Source[] Doc[] Claim[] Finding[] stdout ``` -------------------------------- ### Run driftwatch and see its default output Source: https://github.com/abr4xas/driftwatch/blob/master/README.md Run driftwatch with no arguments to scan the current repository. The output lists each stale claim with its line number, the missing path, and a suggested replacement when one is found. The summary line reports the file count, problem count, error count, and elapsed time, plus how many problems are fixable with --fix. ```console $ driftwatch AGENTS.md ✗ 3 src/util/date.ts path does not exist → src/helpers/date.ts? ✗ 5 src/cli.ts path does not exist 1 file · 2 problems (2 errors) · 59ms 1 fixable with --fix ``` -------------------------------- ### defineConfig with sources for docs and README Source: https://github.com/abr4xas/driftwatch/blob/master/docs/adr/0008-a-specification-is-not-an-agent-context-file.md This configuration was written and run to audit the repository's own documentation. It produced 43 findings, all false positives, because specification documents contain illustrative and external repository paths, not actual drift. ```TypeScript export default defineConfig({ sources: ['docs/**/*.md', 'README.md'] }) ``` -------------------------------- ### Check corpus with pnpm corpus --check Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md Checks the corpus and reports the current snapshot: 66 repos, 236 sources, 26 findings. ```bash pnpm corpus --check ``` -------------------------------- ### Plan fixes with pnpm corpus --fixes Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md Runs the new fix-planning mode that plans every fix across the 66 repos and prints the line before and after. It never writes to the corpus clone. ```bash pnpm corpus --fixes ``` -------------------------------- ### Directory structure of src/ and test/ Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/ARCHITECTURE.md Lists the project's directory structure, showing the organization of source and test files. It highlights the separation of CLI, core, parse, extract, verify, fix, report, and test directories. ```text src/ cli.ts bin entrypoint (the only one touching process) index.ts public API: run(), defineConfig, types run.ts the whole pipeline; returns findings, not output cli/ main.ts the CLI body; receives the environment, returns the exit code args.ts flag parsing on top of node:util parseArgs help.ts the --help text, which is the SPEC.md § 4 contract core/ types.ts Source, Claim, Finding, Verdict, Config errors.ts UserError and the exception normalization helpers exit-codes.ts the three exit codes and how they derive from a count version.ts reads the version from the nearest package.json discover.ts finds sources, respects .gitignore config.ts loads and validates config, merges with defaults ignores.ts parses directives check-id.ts how a check id is matched by --only, --skip and the ignores parse/ markdown.ts mdast + positions, extracts inline code / links / code fences positions.ts absolute offset -> 1-indexed line and column frontmatter.ts YAML of the leading block anchors.ts the anchors a document offers, keyed for matching extract/ index.ts the extractor registry, twin of verify/checks/index.ts context.ts ExtractContext: what every extractor reads from one source paths.ts path Claim[] discard.ts the discard rules of the path extractor context-prose.ts the prose gates: markers that disclaim a nearby claim scripts.ts script Claim[] (npm/pnpm/make/deno) deps.ts dependency Claim[] symbols.ts symbol Claim[] links.ts link Claim[] skill.ts the claim a SKILL.md makes by having a frontmatter block frontmatter.ts frontmatter Claim[] (the block parses, the fields are typed) verify/ repo-index.ts in-memory repo index (the heart) check.ts the shape of a check and its context resolve.ts a claim's text -> path relative to the root, and the pair of resolutions generated.ts directories whose contents are generated, not versioned ignored.ts what git is asked about a path claim, prefetch and lookup path-claim.ts the verdict on a path claim: every rule that can decline the question anchor-index.ts the anchors of the files some link points into manifest.ts the tasks each directory offers: package.json / Makefile / deno.json git.ts per-file churn, a source's last commit checks/ path-missing.ts script-missing.ts skill-frontmatter.ts frontmatter-invalid.ts link-broken.ts dep-missing.ts symbol-missing.ts stale-churn.ts command-unknown.ts fix/ apply.ts applies range edits, preserves formatting suggest.ts candidates + confidence scoring report/ colors.ts decides once whether there is color (NO_COLOR, tty) pretty.ts json.ts github.ts sarif.ts test/ fixtures/ complete synthetic repos, one per scenario corpus/ the real-repo corpus (see §Corpus) repos/ shallow clones pinned to a commit (gitignored, local cache) snapshots/ driftwatch's output per repo (committed) CLASSIFICATION.md every finding reviewed by hand, true or false positive ``` -------------------------------- ### Repository file structure for single-context and multi-context repos Source: https://github.com/abr4xas/driftwatch/blob/master/docs/agents/domain.md Shows the file structure for single-context and multi-context repositories. The single-context layout has CONTEXT.md at the root, docs/adr/ for decisions, and src/. The multi-context layout uses CONTEXT-MAP.md at the root, with per-context CONTEXT.md and docs/adr/ directories under src/. ```text / ├── CONTEXT.md ├── docs/adr/ │ ├── 0001-event-sourced-orders.md │ └── 0002-postgres-for-write-model.md └── src/ ``` ```text / ├── CONTEXT-MAP.md ├── docs/adr/ ← system-wide decisions └── src/ ├── ordering/ │ ├── CONTEXT.md │ └── docs/adr/ ← context-specific decisions └── billing/ ├── CONTEXT.md └── docs/adr/ ``` -------------------------------- ### GitHub Actions workflow to run Driftwatch with SARIF and upload to Code Scanning Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/output.md Use this workflow to run Driftwatch with SARIF output and upload it to GitHub Code Scanning. The first step runs Driftwatch with sarif: true and fail-on-drift: false, producing a SARIF file accessible via the step output 'sarif-file'. The second step uploads that file using the github/codeql-action/upload-sarif@v4 action. ```yaml - uses: abr4xas/driftwatch@v1 id: drift with: sarif: true fail-on-drift: false - uses: github/codeql-action/upload-sarif@v4 with: sarif_file: ${{ steps.drift.outputs.sarif-file }} ``` -------------------------------- ### Run driftwatch twice: default sources and link/broken check Source: https://github.com/abr4xas/driftwatch/blob/master/docs/adr/0008-a-specification-is-not-an-agent-context-file.md Two separate driftwatch invocations: the first uses default sources (docs/agents/**), the second uses a custom config file and the --only link/broken filter. The second invocation is required because sources and the check filter are both global, so a single run cannot express both. ```bash driftwatch # sources: docs/agents/** ``` ```bash driftwatch --config driftwatch.docs.config.ts --only link/broken ``` -------------------------------- ### Preview and apply driftwatch --fix Source: https://github.com/abr4xas/driftwatch/blob/master/README.md Preview or apply automatic fixes. --fix --dry-run shows what would change without modifying anything; --fix applies the change. A correction is applied only when there is exactly one candidate above 0.8 confidence, and it replaces only the claim, never rewriting a relative path in a document that is not at the repo root. ```bash driftwatch --fix --dry-run # what it would change driftwatch --fix # change it ``` -------------------------------- ### Minimal driftwatch CI workflow Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/ci.md Minimal workflow that runs driftwatch on every pull request. Requires actions/checkout because driftwatch builds its index with git ls-files; a shallow checkout is fine, but no checkout is not. Defaults to --format github, so stale claims appear as annotations on the diff. ```yaml name: driftwatch on: [pull_request] permissions: contents: read jobs: drift: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: abr4xas/driftwatch@v0 ``` -------------------------------- ### driftwatch configuration file (TypeScript) Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/SPEC.md Optional configuration file for driftwatch. Supports sources, ignore, checks, knownPaths, and staleThreshold. The checks option adjusts severity per check: 'error' | 'warning' | 'off'. ```TypeScript import { defineConfig } from 'driftwatch' export default defineConfig({ // Additional sources beyond the ones discovered by default sources: ['docs/agent-notes.md'], // Exclude from discovery ignore: ['**/fixtures/**'], // Adjust severity per check: 'error' | 'warning' | 'off' checks: { 'dep/missing': 'off', 'stale/churn': 'warning', 'symbol/missing': 'error', }, // Aliases for paths that exist but not on disk (e.g. build outputs) knownPaths: ['dist/**', '.next/**'], staleThreshold: 15, }) ``` -------------------------------- ### driftwatch CLI format flags Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/output.md Shows the driftwatch command with its default pretty format and the --format flag for json, github, and sarif. The --json flag is an alias for --format json. ```bash driftwatch # pretty, for a person at a terminal driftwatch --format json # for a program driftwatch --format github # for GitHub Actions annotations driftwatch --format sarif # for GitHub Code Scanning ``` -------------------------------- ### Cursor frontmatter globs list in .cursor/rules/cli-whitelist-docs.mdc Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md Frontmatter from `.cursor/rules/cli-whitelist-docs.mdc` in the `fancy1108/Clutch` repo. The value is a comma-separated list that the frontmatter extractor treats as a single path; all three files exist, but the joined string does not. The fix would split the value into one claim per item, which would raise detection rather than lower it. ```plaintext globs: services/orchestrator/src/tools_status.py,apps/desktop/src/services/cliInstallGuides.ts,services/orchestrator/src/engine_router.py ``` -------------------------------- ### driftwatch.config.ts sources declaration Source: https://github.com/abr4xas/driftwatch/blob/master/docs/adr/0008-a-specification-is-not-an-agent-context-file.md The shipped configuration declares the source directory as docs/agents/**/*.md. This is the only source pattern in the shipped config. ```typescript sources: ['docs/agents/**/*.md'] ``` -------------------------------- ### Source table row and bullet describing file paths Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md A table row and bullet list showing the original file paths and where they are copied or referenced. This output still represents the source material that caused the false fixable findings. ```text | `.claude/commands/tfw-task.md`, `.agent/workflows/tfw-task.md` | Adapter-only meta-workflow; ... | - Antigravity: `.agent/workflows/tfw-plan.md`, `tfw-handoff.md`, `tfw-review.md` (+ others) ``` -------------------------------- ### True positive: missing 'test-mvcc' target in turso SKILL.md Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md This bash snippet from tursodatabase/turso's .claude/skills/mvcc/SKILL.md line 91 instructs running 'make test-mvcc', but the Makefile has no such target and no include, making it a true positive for the script/missing check. ```bash # TCL tests with MVCC make test-mvcc ``` -------------------------------- ### RepoIndex type definition Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/ARCHITECTURE.md Defines the in-memory index structure used for performance-critical verifications. It stores file paths, directories, basename mappings, and parsed manifests. The index is built once per run and enables O(1) verification per claim. ```typescript type RepoIndex = { files: Set // every relative path dirs: Set byBasename: Map // 'auth.ts' → ['src/auth.ts', 'test/auth.ts'] manifests: Map // dir → parsed package.json (monorepo) } ``` -------------------------------- ### Run driftwatch without the action via npx Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/ci.md One-line advisory run without the action. The action adds the Node check, version pin, SARIF pass, and exit-code handling; for a simple advisory run this line is sufficient. ```yaml - run: npx @abr4xas/driftwatch --format github ``` -------------------------------- ### Fixable findings output from condition 2 Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md Output list from a check, showing three fixable findings where the suggestion is incorrect. The first is a true positive, but the other two are false because the target files belong to another tool's directory. ```text .claude/commands/tfw-config.md:123 .agent/workflows/tfw-task.md -> .claude/commands/tfw-task.md (1, fixable) .claude/commands/tfw-init.md:184 .agent/workflows/tfw-plan.md -> .claude/commands/tfw-plan.md (1, fixable) ``` -------------------------------- ### Use abr4xas/driftwatch@v1 in a workflow Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/output.md Minimal usage of the driftwatch action in a GitHub Actions workflow step. See ci.md for the action's inputs. ```yaml - uses: abr4xas/driftwatch@v1 ``` -------------------------------- ### Update floating action tag Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/ROADMAP.md Manually move the floating action tag 'v0' to a new version tag. This is required because nothing automates this step. The command forces the tag update and pushes it to the origin remote. ```bash git tag -f v0 v && git push -f origin v0 ``` -------------------------------- ### Override driftwatch version with version input Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/ci.md Override the driftwatch version the action runs. The action runs the version that shipped with it; @v0 is a floating tag moved to each 0.x release. Pin @v0.2.0 or set version to a specific version, path, or .tgz to control what runs. ```yaml - uses: abr4xas/driftwatch@v0 with: version: 0.3.0-beta.1 ``` -------------------------------- ### Use driftwatch in GitHub Actions Source: https://github.com/abr4xas/driftwatch/blob/master/README.md Add driftwatch to a GitHub Actions workflow. Every stale claim becomes an annotation on the diff line that makes it. Set fail-on-drift: false to make it advisory, or sarif: true to write a SARIF file for Code Scanning. ```yaml - uses: actions/checkout@v7 - uses: abr4xas/driftwatch@v0 ``` -------------------------------- ### GitHub error annotation for a finding Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/output.md Native GitHub annotation for an error-severity finding. The job log is the transport, so any non-workflow-command line is noise. title carries the check id, the only stable grouping/search key. A run with no findings emits nothing at all, not even a blank line. ```text ::error file=CLAUDE.md,line=12,col=4,endColumn=19,title=path/missing::path does not exist → src/auth/index.ts? ``` -------------------------------- ### fixes top-level block under --fix Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/output.md Top-level block emitted whenever --fix is passed. Reports applied counts, dryRun flag, and per-file edits with absolute byte offsets and before/after text. Offsets refer to the file as it is on disk before any rewrite. ```jsonc "fixes": { "applied": 1, "files": 1, "dryRun": true, "edits": [ { "file": "AGENTS.md", "line": 3, "start": 1204, "end": 1219, "before": "src/util/date.ts", "after": "src/helpers/date.ts" } ] } ``` -------------------------------- ### Declare generated file reference in skill.ts Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md Declares a generated file reference in a skill's configuration. The file is not committed or gitignored and only appears after a build step, making it a false positive for missing-file checks. ```typescript "references/ai-phrases-to-avoid.md": AI_PHRASES_TO_AVOID, ``` -------------------------------- ### driftwatch --fix warning for uncommitted changes Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/fixing.md When a file about to be edited has uncommitted changes, driftwatch prints a warning to stderr before editing it anyway. The warning text is 'driftwatch: uncommitted changes in AGENTS.md'. ```console $ driftwatch --fix driftwatch: uncommitted changes in AGENTS.md ``` -------------------------------- ### Advisory driftwatch run with fail-on-drift: false Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/ci.md Advisory mode that annotates the diff without blocking the merge. fail-on-drift: false silences a finding, not a failure: if driftwatch itself breaks (bad config, missing path), the step still fails with exit 2. ```yaml # Advisory: annotate the diff, never block the merge - uses: abr4xas/driftwatch@v0 with: fail-on-drift: false ``` -------------------------------- ### Path fix for Endle/fireSeqSearch Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md The single fixable finding in the corpus: a path in CLAUDE.md is one directory out of date. The replacement covers only the path, leaving the surrounding line intact. ```diff # Endle/fireSeqSearch CLAUDE.md:145 [path/missing] - - Query path: `fire_seq_search_server/src/query_engine/semantic_query.rs` + - Query path: `fire_seq_search_server/src/semantic_query.rs` ``` -------------------------------- ### Frontmatter invalid finding in colinhacks/zod Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md The only frontmatter/invalid finding in the corpus, in colinhacks/zod. The value contains quotes, so quoting it would require escaping them, which is why it stays unfixable. ```text .claude/skills/security-advisory/SKILL.md:3 invalid YAML: Nested mappings are not allowed in compact mappings ``` -------------------------------- ### Check module shape Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/ARCHITECTURE.md Defines a check module with an id, tier, defaultSeverity, claimKinds, and a run function that returns a CheckReport or null. The check does not set its own severity; the config overrides it via checks mapping. ```typescript export const check: Check = { id: 'path/missing', tier: 1, defaultSeverity: 'error', claimKinds: ['path'], run(claim, ctx): CheckReport | null { /* ... */ }, } ``` -------------------------------- ### discard.ts pattern for trailing capital number Source: https://github.com/abr4xas/driftwatch/blob/master/test/corpus/CLASSIFICATION.md Adds a pattern to discard.ts to ignore words with a trailing capital representing a number, such as 'iterN'. The pattern requires the word before the capital to be all lowercase and the capital to be one of N, M, K, X, Y, Z. This is narrow and costs detections rather than buys them. ```plaintext research/iterN/ "Count `research/iterN/` folders research/iterN/RES.md (N = highest folder number + 1, or 1 if none)" research/iterN-1/RES.md ``` -------------------------------- ### Data model types: Source, Claim, Finding Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/ARCHITECTURE.md Defines the core data model for driftwatch: Source, Claim, and Finding types. The Claim type includes an offset field that enables --fix by replacing an exact byte range, and a fact field that is a discriminated union (ClaimFact) rather than an open record, enforced by the compiler in core/types.ts. ```ts type Source = { path: string // relative to root absPath: string kind: 'claude-md' | 'agents-md' | 'skill' | 'subagent' | 'command' | 'cursor-rule' | 'copilot' content: string baseDir: string // directory that relative paths resolve against } type Claim = { kind: 'path' | 'script' | 'dep' | 'symbol' | 'link' | 'frontmatter' source: Source text: string // the exact claimed fragment range: { line: number; column: number; endLine: number; endColumn: number } offset: [number, number] // absolute offsets into content, for --fix context: 'inline-code' | 'code-fence' | 'link' | 'frontmatter' | 'prose' fact?: ClaimFact // discriminated by `subject`: script | parse | key | skill-block } type Finding = { check: string // 'path/missing' severity: 'error' | 'warning' claim: Claim message: string suggestion?: { value: string; confidence: number; fixable: boolean } } ``` -------------------------------- ### Ignore directives in Markdown Source: https://github.com/abr4xas/driftwatch/blob/master/docs/guide/usage.md Use HTML comments to ignore findings on the next line, by check ID, or for the entire file. Directives apply to findings, so a misspelled ID silences nothing. ```markdown `src/planned/feature.ts` does not exist yet, it is the plan ``` -------------------------------- ### Inline ignore comments in Markdown Source: https://github.com/abr4xas/driftwatch/blob/master/docs/spec/SPEC.md Markdown comments to ignore driftwatch checks. An ignore with no id applies to every check on that line; with an id, only to that check. ```Markdown `src/planned/feature.ts` does not exist yet, it is the plan ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.