Find the code. Find the test. Check the behavior.

Investigate a refresh-token expiry boundary in a small example included in the npm package. You will map the repo, build a task packet, and load the relevant code without including unrelated billing and catalog files.

1. Install in a new working directory

Requires Node.js 20 or newer. The sample uses only Node's built-in test runner.

npm init -y
npm install @anthony-maio/cartograph@1.2.2
npx cartograph --version

2. Follow one task through the codebase

npx cartograph analyze ./node_modules/@anthony-maio/cartograph/examples/auth-refresh --static
npx cartograph packet ./node_modules/@anthony-maio/cartograph/examples/auth-refresh --type bug-fix --task "fix refresh token expiry"
npx cartograph context ./node_modules/@anthony-maio/cartograph/examples/auth-refresh --task "fix refresh token expiry" --static --json

Look for src/auth/refresh.js in the packet's keyFiles and tests/auth-refresh.test.js in validationTargets. The context bundle includes these files and their clock helper. The unrelated billing and catalog files should be absent.

3. Run the checks

node --test ./node_modules/@anthony-maio/cartograph/examples/auth-refresh/tests/auth-refresh.test.js

Expected result: three passing tests. The sample implementation converts a millisecond clock to Unix seconds, rejects a token exactly at expiry, and rejects revoked sessions. The example is already correct; its tests describe the behavior you would preserve while investigating a bug.

What this establishes

The installed package can locate an implementation and its test, return a focused context bundle, and leave unrelated code out. Cartograph uses local heuristics here. It does not prove that the selected file contains a bug or run the tests on your behalf.

Use the same commands with your repository path and a concrete task. Omit --static only when you want the separate model-backed context workflow and have configured a provider.

Inspect the sample source | Full walkthrough | Back to setup