Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Active tickets

- [ ] [`ticket-083`](project/ticket-083/README.md) — keep workspace comparison
artifacts and caches outside analysed repository state. Current state:
`IN_PROGRESS / PUBLICATION`.
- [ ] [`ticket-054`](project/ticket-054/README.md) — restore skills-agent
discovery, prove a todo2code → Repair PR → independent Validator hand-off,
then add three bounded todo2code-grounded skills. Current state:
Expand Down
1 change: 1 addition & 0 deletions project/TICKETS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions project/ticket-083/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions project/ticket-083/ai-codex-logs.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions project/ticket-083/ai-codex.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions project/ticket-083/changelog.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions project/ticket-083/intent.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions project/ticket-083/preprompt.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions src/comparison/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@ export async function compareWorkspaceIntent(
const baseRef = options.baseRef?.trim() || defaultBaseRef();
const baseCommit = (await git(repositoryRoot, ['rev-parse', '--verify', `${baseRef}^{commit}`])).trim();
const headCommit = (await git(repositoryRoot, ['rev-parse', '--verify', 'HEAD^{commit}'])).trim();
const status = await git(repositoryRoot, ['status', '--porcelain=v1', '--untracked-files=all']);
const statusArguments = ['status', '--porcelain=v1', '--untracked-files=all'];
const outputRelativeToRepository = path.relative(repositoryRoot, path.resolve(root, outputDir));
if (outputRelativeToRepository && !outputRelativeToRepository.startsWith('..') && !path.isAbsolute(outputRelativeToRepository)) {
const normalizedOutput = outputRelativeToRepository.replace(/\\/g, '/');
statusArguments.push('--', '.', `:(exclude,top)${normalizedOutput}`, `:(exclude,top)${normalizedOutput}/**`);
}
const status = await git(repositoryRoot, statusArguments);
const changedFiles = status.split(/\r?\n/).filter(Boolean).map((line) => line.slice(3)).sort();
const [behind, ahead] = parseAheadBehind(await git(repositoryRoot, ['rev-list', '--left-right', '--count', `${baseCommit}...HEAD`]));
const deadlineDecision = calculateWorkspaceComparisonDeadline(
Expand All @@ -169,8 +175,18 @@ export async function compareWorkspaceIntent(
const baseOptions = await optionsForRoot(baseRoot, { ...pipelineOptions, root: baseRoot, outputDir: '.intent-compare-base' });
const currentOptions = await optionsForRoot(root, { ...pipelineOptions, root, outputDir });
const boundedOpenRouter = { ...config.openRouter, signal: deadlineController.signal };
const baseConfig = { ...config, root: baseRoot, openRouter: boundedOpenRouter };
const currentConfig = { ...config, root, openRouter: boundedOpenRouter };
const baseConfig = {
...config,
root: baseRoot,
outputDir: baseOptions.outputDir,
openRouter: boundedOpenRouter,
};
const currentConfig = {
...config,
root,
outputDir: currentOptions.outputDir,
openRouter: boundedOpenRouter,
};

let baseRun: Awaited<ReturnType<typeof runPipeline>>;
let currentRun: Awaited<ReturnType<typeof runPipeline>>;
Expand Down
14 changes: 14 additions & 0 deletions test/workspace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ test('workspace comparison measures origin/main against uncommitted filesystem i
assert.equal(baseManifest.stages.summary.status, 'skipped');
assert.equal(workspaceManifest.stages.summary.status, 'skipped');
assert.equal(baseManifest.configuration.summaryLlm, false);
assert.equal(await pathExists(path.join(root, '.intent')), false, 'ambient cache directory is not used');

const repeated = await compareWorkspaceIntent({
root,
outputDir: '.intent-workspace',
includeDocumentationLlm: false,
}, config);
assert.deepEqual(
repeated.workspace.changedFiles,
['runtime.ts', 'unplanned.ts'],
'existing comparison evidence is excluded from the observed Git state',
);

const outside = path.join(parent, 'outside-comparison');
await assert.rejects(
Expand All @@ -131,4 +143,6 @@ test('workspace comparison measures origin/main against uncommitted filesystem i
assert.ok(await pathExists(comparisonFile));
assert.equal(path.relative(outside, comparisonFile).startsWith('..'), false, 'artifacts land under the requested directory');
assert.equal(await pathExists(path.join(root, 'outside-comparison')), false);
assert.equal(await pathExists(path.join(root, '.intent')), false, 'external output also owns extractor caches');
assert.ok(await pathExists(path.join(outside, 'cache')), 'extractor cache follows the external output directory');
});
Loading