AGENTS.md instructions for /Users/savekirk/dev/ai/entire/session-bridge <INSTRUCTIONS>…
- User
AGENTS.md instructions for /Users/savekirk/dev/ai/entire/session-bridge
Project Structure & Module Organization
src/extension.tsis the extension entrypoint and wires activation, commands, and views.src/components/contains UI-facing providers and panels such as the status bar item, checkpoint tree, and active session tree.src/checkpoints/holds the session/checkpoint domain logic, git enrichment, storage, transcript parsing, and search helpers. General utilities live in top-levelsrc/*.tsfiles such asworkspaceProbe.tsandrunCommand.ts. Tests live undersrc/test/, with reusable checkpoint fixtures insrc/test/checkpoints/fixtures/.media/stores extension icons. Treatdist/andout/as generated output.Build, Test, and Development Commands
pnpm compile: run type-checking, ESLint, and the esbuild bundle intodist/extension.js.pnpm watch: run esbuild watch mode andtsc --watchtogether for local development.pnpm check-types: run strict TypeScript checks only.pnpm lint: lintsrc/with the repository ESLint config.pnpm test: compile tests, rebuild the extension, and run the VS Code test harness.pnpm package: build the production bundle used for publishing.
Coding Style & Naming Conventions
Use strict TypeScript and follow the existing code style: tabs for indentation, semicolons, and mostly single-quoted imports/strings. Use
PascalCasefor classes, providers, and exported types; usecamelCasefor functions and locals; useUPPER_SNAKE_CASEfor extension-wide constants. Keep command and context identifiers namespaced, for examplesession.bridge.entire.refresh. Let ESLint catch small consistency issues, and do not hand-edit generated files indist/orout/.Testing Guidelines
Write tests as
*.test.tsundersrc/test/, mirroring the feature area when possible, such assrc/test/checkpoints/. This project uses Mocha with@vscode/test-cliandvscode-test, compiling test files toout/test/**/*.test.js. Prefer fixture-backed tests for checkpoint parsing, git metadata joins, and tree/detail view models. No formal coverage threshold is configured, but every behavior change should include or update targeted tests. - User
<environment_context> /Users/savekirk/dev/ai/entire/session-bridge zsh <current_date>2026-04-08</current_date> Africa/Nairobi </environment_context>
- User
In session metadata, created_at is when the session was ended and the metadata created so in src/checkpoints/transcript.ts and src/checkpoints/orchestration.ts, the createdAt and lastActivityAt should reflect this. The first item in the jsonl is when the session is created/started
- Assistant
I’m checking how session timestamps are derived in
src/checkpoints/transcript.tsandsrc/checkpoints/orchestration.ts, then I’ll adjust them socreatedAt/lastActivityAtuse the first JSONL item rather than metadatacreated_at. - Assistant
I found the current behavior: committed sessions use
session.metadata.createdAtas both the start candidate and the fallback forlastActivityAt. I’m reading the session aggregation path and existing transcript tests now so I can change the timestamp source without disturbing unrelated card logic. - Assistant
The important ambiguity is whether
lastActivityAtshould mean “latest transcript event” or “session end/metadata write time.” I’m checking the fixture layout and current aggregation behavior so I can match the repository’s existing semantics instead of guessing. - Assistant
There’s one subtle knock-on effect: the committed-session map currently uses
createdAtto decide which checkpoint snapshot is “latest” for a session. If I switchcreatedAtto the transcript start time, that comparison needs to move to the end/last-activity timestamp or it will stop advancing multi-checkpoint sessions correctly. - Assistant
I have the change shape now: add a “first transcript timestamp” helper, derive committed-session
createdAtfrom it, and switch the “latest snapshot wins” comparison to use end/last-activity time instead of start time. I’m reading the module test harness so I can cover the metadata-vs-transcript mismatch with a targeted regression test rather than just changing production code. - Assistant
I’m at the edit stage. I’m going to patch the transcript helpers, update the committed-session aggregation to separate start time from end/last-activity time, then add one direct transcript test and one end-to-end module regression that uses mismatched metadata/transcript timestamps.
- Assistant
git statusshows an existing modification in src/checkpoints/transcript.ts. I’m checking that diff first so I can layer this change on top of it without overwriting user work. - Assistant
The first patch didn’t apply cleanly because
transcript.tsalready has a local doc edit in the same area. I’m re-reading the exact block and applying a narrower patch so I don’t trample that existing change. - Assistant
I’m adding the regression at the module level rather than only unit-testing the helper. That way the test covers the actual session-card aggregation path, including the “later checkpoint snapshot wins” behavior when a newer snapshot lacks transcript timestamps.
- Assistant
The code changes are in place. I’m reading the patched sections now for type/lint issues before I run the targeted test suite, since the new module test introduces a fixture-cloning helper and an optional parameter on the repo harness.
- Assistant
The implementation looks internally consistent. I’m running the project checks now, starting with TypeScript/lint and then the test suite, to catch any fallout from the new transcript export and the updated test harness.
- Assistant
Type-check and lint are clean. The VS Code harness build completed, but
pnpm testaborts insidevscode-testafter locating the cached VS Code install; it isn’t a code failure from this change, so I’m checking the local test runner next to see whether I can verify the checkpoint tests another way in this environment. - Assistant
The VS Code Electron harness isn’t reliable in this sandbox, but the checkpoint tests themselves don’t depend on the VS Code runtime. I’m running the compiled checkpoint tests directly under Mocha so I can still verify the behavior change end to end.
- Assistant
The checkpoint-specific tests are clean under direct Mocha execution after compilation. I’m pulling exact file locations now for the summary, and I’ll call out separately that
pnpm teststill aborts in the local VS Code harness despite the compiled checkpoint suite passing. - Assistant
Updated committed session timestamp derivation. transcript.ts now exposes
extractTranscriptFirstTimestamp, and orchestration.ts now uses the first transcript event forcreatedAt, the latest transcript event forlastActivityAtwith metadata fallback, and compares merged session snapshots bylastActivityAtinstead ofcreatedAt.I added regression coverage in transcript.test.ts and module.test.ts to cover both direct transcript parsing and the checkpoint/session aggregation path.
Verification:
pnpm check-types,pnpm lint, andnode node_modules/.pnpm/mocha@11.7.5/node_modules/mocha/bin/mocha.js --ui tdd out/test/checkpoints/*.test.jspassed. still aborts inside with after finding the cached VS Code install, so I verified the compiled checkpoint suite directly.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.