import { describe, expect, it } from 'bun:test';
import { isStateArtifactFile, partitionGeneratedFiles } from './artifact-routing.js';
describe('artifact routing', () => {
    // User story: As a developer keeping definitions in quickback/, I need drizzle migration state
    // artifacts written to quickback so compile output does not keep recreating root drizzle folders.
    it('classifies drizzle paths as state artifacts', () => {
        expect(isStateArtifactFile({
            path: 'drizzle/auth/meta/_journal.json',
            content: '{"version":"1"}',
        })).toBe(true);
    });
    // User story: As a platform operator, I need security contract reports treated as state artifacts
    // so they stay alongside quickback definitions and can be reviewed across compile runs.
    it('classifies security report artifacts by kind payload', () => {
        expect(isStateArtifactFile({
            path: 'reports/security-contracts.report.json',
            content: JSON.stringify({ kind: 'quickback-security-contract-report' }),
        })).toBe(true);
        expect(isStateArtifactFile({
            path: 'reports/security-contracts.report.sig.json',
            content: JSON.stringify({ kind: 'quickback-security-contract-signature' }),
        })).toBe(true);
    });
    // User story: As an API developer, I need runtime files to remain in outputDir so application code,
    // handlers, and configs continue to compile and deploy from the generated runtime tree.
    it('keeps non-state runtime files in runtime bucket', () => {
        const files = [
            { path: 'src/index.ts', content: 'export {};' },
            { path: 'openapi.json', content: '{"openapi":"3.0.0"}' },
            { path: 'drizzle/auth/meta/_journal.json', content: '{"version":"1"}' },
        ];
        const { runtimeFiles, stateFiles } = partitionGeneratedFiles(files);
        expect(runtimeFiles.map((f) => f.path)).toEqual(['src/index.ts', 'openapi.json']);
        expect(stateFiles.map((f) => f.path)).toEqual(['drizzle/auth/meta/_journal.json']);
    });
});
//# sourceMappingURL=artifact-routing.test.js.map