Repository navigation
fix(migrate): drop generic and numeric inferred triggers; match module paths case-insensitively (#349) - #386
Merged
Merged
Conversation
… match module paths case-insensitively (#349) Trigger inference kept tokens like images, components, workflow, release, apps, via and all-digit tokens, which then loaded the module for almost any task. GENERIC_HEADING_WORDS now covers the structure, process and filler words of real CLAUDE.md headings; numbers and version numbers are dropped; a generic word that is part of the module's own stem is still kept. The manifest writer, the dry-run dedupe and bootstrap's orphan detection compare module paths by moduleKey (normalized, lowercased), so Infra.adf and infra.adf are one module and never get two entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ems (#349) Review fixes. Folding everywhere hid a differently spelled module on Linux, where the loader opens the exact name, and stopped bootstrap repairing a miscased Core.adf that doctor checks by exact name. Now: - moduleKey folds only when isCaseInsensitiveDir(manifest dir) (overridable via RegisterOptions.caseInsensitive); bootstrap's orphan check does the same - a required DEFAULT_LOAD module is always matched by its exact name - registerModules plans two spellings of one file once, from both item sets - inferTriggers and the dry-run dedupe go back to exact matching - version tokens like v20.x and v2.0-beta are dropped too - correct the trigger-matching wording; no blank line in the CHANGELOG list Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ence # Conflicts: # CHANGELOG.md
…d of adding a second one (#349) On a case-insensitive filesystem, a manifest listing `Core.adf` with `core.adf` on disk got a second `core.adf` bullet, and `adf bundle` loaded the file twice. The DEFAULT_LOAD bullet is now respelled in place to the name on disk, through the same re-parse guard; when the guard refuses, the entry is kept with a warning. Under ON_DEMAND it is reported, not added. - isCaseInsensitiveDir compares inode numbers (directory listing when the filesystem reports 0), so a MANIFEST.ADF is detected. - Generic trigger words: task verbs (add, fix, create, ...) and generic nouns (known, requirements, examples, support, ...). - v2.0-beta-2 is dropped as a version token. - Already-registered detail names the matched spelling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t spelling in the ON_DEMAND move hint (#349) `respelled` is now 'written' or 'planned', so a dry-run detail no longer reports a respelling that was not made. The ON_DEMAND warning for a miscased Core.adf says to move it `as core.adf`, the name doctor checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #349
Problem
Trigger inference in
packages/cli/src/commands/adf-manifest-register.tsremoved onlySTOPWORDSand a six-wordGENERIC_HEADING_WORDSlist. Heading words likeimages,components,workflow,release,appsandvia, and tokens made only of digits, got through and were registered as ON_DEMAND triggers. The router matches each trigger against every word of the task (exactly, or as a long enough prefix stem), so these weak triggers loaded the module for almost every request.The manifest writer also compared module paths case-sensitively.
Infra.adfand an existinginfra.adfentry could therefore get two entries for what is one file on Windows and macOS.Fix
A wider
GENERIC_HEADING_WORDSlist, grouped by kind:guide,overview,usage,getting started, ...workflow,release,steps,setup,commands,files,code,apps,components,images, ...via,using,when,how,all,always,never, ...Domain words such as
deployment,testing,database,auth,docker,api,docs,config,scriptsandassetsare deliberately not on the list.Numbers and version numbers are dropped:
1,2024,1.2,v2.1,v20.x,v2.0-beta.No over-pruning of a module's own name. A generic word that is part of the module's file stem is still used, so
release.adfkeepsrelease.Module paths are compared by
moduleKey(path, caseInsensitive), which lowercases the normalized path only where the filesystem is case-insensitive. That is detected byisCaseInsensitiveDir(dir): it looks upmanifest.adfwith its case swapped, andRegisterOptions.caseInsensitiveoverrides it in tests.registerModulesplans two spellings of one file once, with triggers inferred from the items of both.already registered as infra.adf under ON_DEMAND).core.adf,state.adf) is always matched by its exact name, becausefindMissingDefaultLoadand doctor check it that way.Core.adf.Existing manifest entries are never rewritten. Only new registrations change.
Tests
adf-manifest-register.test.ts:Build & Test Commands,Development Workflow,Release Process (v2.1),Step 1: Install Dependencies,Images and Components,Apps via Turborepo,Node 20 / pnpm 9 Setup, ...), each checked against its exact expected triggers.inferTriggers;registerModulesmerges the items of both spellings;core.adfis added when the manifest only hasCore.adf, andfindMissingDefaultLoadis then satisfied;v20.x,1.x,v2.0-beta,v2.1.0-rc.1) are dropped andES2022is kept.workflow,releaseandappsas example triggers; they now use domain words.bootstrap.test.ts:Infra.adfon disk with aninfra.adfmanifest entry. On a case-insensitive filesystem it is not reported as an orphan and gets no second entry; on a case-sensitive one it is reported and registered. So CI on Linux covers the other branch.pnpm run benchmark:contextpasses.🤖 Generated with Claude Code