Skip to content

Commit f329b48

Browse files
authored
fix: keep Ambient Resume for Classic-only projects (#338)
* fix: keep Ambient Resume for Classic projects * chore: align version to beta.19 and consolidate changelog --------- Co-authored-by: mayzhaoyu <26018762+mayzhaoyu@users.noreply.github.com>
1 parent 147b1f2 commit f329b48

10 files changed

Lines changed: 65 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
All notable changes to @rpamis/comet will be documented in this file.
44

5-
## What's Changed [0.4.0-beta.20] - 2026-08-16
5+
## What's Changed [0.4.0-beta.19] - 2026-08-15
66

77
### Added
88

99
- **Repository-owned Native pull-request finish providers**: Projects can opt into a structured repository command for PR title, body, template, and policy validation while Comet retains commit, push, remote base/head/SHA verification, existing-PR reuse, recoverable failure state, and safe worktree cleanup.
1010

11-
## What's Changed [0.4.0-beta.19] - 2026-08-15
12-
1311
### Changed
1412

1513
- **Dashboard artifact previews**: Fullscreen previews now close with Escape, keep long tables horizontally scrollable, preserve readable table headers, and use a larger directory navigation scale.
@@ -18,6 +16,7 @@ All notable changes to @rpamis/comet will be documented in this file.
1816

1917
### Fixed
2018

19+
- **Classic Ambient Resume**: `comet init` and `comet update` now keep the managed Ambient Resume instructions for Classic-only projects when `ambient_resume` is enabled, so re-running the commands no longer removes the block from `AGENTS.md` or `CLAUDE.md`.
2120
- **Fork pull request greetings**: First-time contributors now receive the repository guidance comment when opening a pull request from a fork, without weakening the read-only permissions of workflows that execute contributor code.
2221
- **Pull request template checks**: Pull requests now receive an actionable comment and a failing check when items from the repository template are missing or its checklist is incomplete.
2322

app/commands/init.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,8 +1124,7 @@ export async function initCommand(
11241124
await syncCometProjectInstructions(
11251125
projectPath,
11261126
language.id,
1127-
includesWorkflow(workflowSelection, 'native') &&
1128-
(initialProjectConfigDocument?.ambient_resume ?? true),
1127+
initialProjectConfigDocument?.ambient_resume ?? true,
11291128
);
11301129

11311130
const successfulCometPlatforms = new Set(

app/commands/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1975,7 +1975,7 @@ async function updateSingleProject(
19751975
const projectInstructionResult = await syncCometProjectInstructions(
19761976
projectPath,
19771977
projectLanguageId,
1978-
nativeProject && (projectConfigDocument?.ambient_resume ?? true),
1978+
projectConfigDocument?.ambient_resume ?? true,
19791979
);
19801980
projectInstructionsUpdated = projectInstructionResult.changed;
19811981
if (projectInstructionsUpdated > 0) {

assets/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.4.0-beta.20",
2+
"version": "0.4.0-beta.19",
33
"skills": [
44
"comet/SKILL.md",
55
"comet/agents/openai.yaml",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rpamis/comet",
3-
"version": "0.4.0-beta.20",
3+
"version": "0.4.0-beta.19",
44
"description": "Agent Skill Harness For Turning Ideas Into Evaluated Workflows",
55
"keywords": [
66
"comet",

test/app/cli-help.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('CLI help text', () => {
2929
expect(help.status, help.stderr).toBe(0);
3030
expect(help.stdout).toContain(tagline);
3131
expect(packageJson.description).toBe(tagline);
32-
expect(packageJson.version).toBe('0.4.0-beta.20');
32+
expect(packageJson.version).toBe('0.4.0-beta.19');
3333
});
3434

3535
it('marks bundle as the advanced backend and skill Engine runs as advanced', () => {

test/app/init-e2e.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,31 @@ describe('comet init E2E', () => {
506506
).rejects.toMatchObject({ code: 'ENOENT' });
507507
});
508508

509+
it('installs Ambient Resume instructions for Classic-only project init', async () => {
510+
mockExternalSuccess();
511+
await fs.mkdir(path.join(tmpDir, '.claude'), { recursive: true });
512+
await fs.writeFile(path.join(tmpDir, 'AGENTS.md'), '# User\n\nKeep this.\n', 'utf8');
513+
await fs.writeFile(path.join(tmpDir, 'CLAUDE.md'), '# User\n\nAlso keep this.\n', 'utf8');
514+
515+
const { initCommand } = await import('../../app/commands/init.js');
516+
const result = await captureJsonOutput(() =>
517+
initCommand(tmpDir, { yes: true, json: true, workflow: 'classic', language: 'en' }),
518+
);
519+
520+
expect(result).toMatchObject({
521+
workflow: 'classic',
522+
initializedWorkflows: ['classic'],
523+
});
524+
const agents = await fs.readFile(path.join(tmpDir, 'AGENTS.md'), 'utf8');
525+
const claude = await fs.readFile(path.join(tmpDir, 'CLAUDE.md'), 'utf8');
526+
for (const content of [agents, claude]) {
527+
expect(content).toContain('<comet-ambient-resume>');
528+
expect(content).toContain('comet resume-probe . --stdin --json');
529+
}
530+
expect(agents).toContain('# User\n\nKeep this.');
531+
expect(claude).toContain('# User\n\nAlso keep this.');
532+
});
533+
509534
it('adds Classic with the docs layout when a Native-only project is reinitialized as Both', async () => {
510535
mockExternalSuccess();
511536
await fs.mkdir(path.join(tmpDir, '.claude'), { recursive: true });

test/app/update.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,6 +3526,36 @@ describe('update command helpers', () => {
35263526
expect(claude).toContain('<comet-ambient-resume>');
35273527
});
35283528

3529+
it('installs ambient resume instructions for Classic-only projects', async () => {
3530+
await arrangeClassicDocsOpenSpecUpdate(tmpDir);
3531+
await fs.writeFile(path.join(tmpDir, 'AGENTS.md'), '# User\n\nKeep this.\n', 'utf8');
3532+
await fs.writeFile(path.join(tmpDir, 'CLAUDE.md'), '# User\n\nAlso keep this.\n', 'utf8');
3533+
3534+
const fakeHome = path.join(tmpDir, 'fake-home-classic-instructions');
3535+
const homedirSpy = vi.spyOn(os, 'homedir').mockReturnValue(fakeHome);
3536+
const log = vi.spyOn(console, 'log').mockImplementation(() => undefined);
3537+
let json: string;
3538+
try {
3539+
await updateCommand(tmpDir, { json: true, skipNpm: true });
3540+
json = log.mock.calls.map((call) => call.join(' ')).join('\n');
3541+
} finally {
3542+
log.mockRestore();
3543+
homedirSpy.mockRestore();
3544+
}
3545+
3546+
const result = JSON.parse(json);
3547+
expect(result.projectInstructions.updated).toBe(2);
3548+
3549+
const agents = await fs.readFile(path.join(tmpDir, 'AGENTS.md'), 'utf8');
3550+
const claude = await fs.readFile(path.join(tmpDir, 'CLAUDE.md'), 'utf8');
3551+
for (const content of [agents, claude]) {
3552+
expect(content).toContain('<comet-ambient-resume>');
3553+
expect(content).toContain('comet resume-probe . --stdin --json');
3554+
}
3555+
expect(agents).toContain('# User\n\nKeep this.');
3556+
expect(claude).toContain('# User\n\nAlso keep this.');
3557+
});
3558+
35293559
it('removes ambient resume instructions when the project disables the probe', async () => {
35303560
await fs.mkdir(path.join(tmpDir, '.comet'), { recursive: true });
35313561
await fs.writeFile(

test/repository/release-metadata.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('release metadata', () => {
1616
readFileSync(path.join(repositoryRoot, 'assets', 'manifest.json'), 'utf8'),
1717
) as { version: string };
1818

19-
expect(packageJson.version).toBe('0.4.0-beta.20');
19+
expect(packageJson.version).toBe('0.4.0-beta.19');
2020
expect(packageLock.version).toBe(packageJson.version);
2121
expect(packageLock.packages[''].version).toBe(packageJson.version);
2222
expect(assetsManifest.version).toBe(packageJson.version);

0 commit comments

Comments
 (0)