mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-19 17:46:36 +03:00
Centralize critique snapshot reading (#511)
Make critique storage the single owner of snapshot discovery and frontmatter parsing, and keep context signals focused on summarizing the canonical result. AI-assisted: Prepared by Codex under pbakaus's scheduled architecture-refactor authorization.
This commit is contained in:
@@ -76,6 +76,22 @@ describe('gatherSignals', () => {
|
||||
assert.equal(s.critique.latest.slug, 'home');
|
||||
});
|
||||
|
||||
it('reads the newest critique snapshot across target slugs', async () => {
|
||||
write('.impeccable/critique/2026-05-01T10-00-00Z__home.md',
|
||||
'---\nslug: home\nscore: 6\np0: 1\np1: 3\ntimestamp: 2026-05-01T10-00-00Z\n---\nbody\n');
|
||||
write('.impeccable/critique/2026-05-02T10-00-00Z__pricing.md',
|
||||
'---\nslug: pricing\nscore: 9\np0: 0\np1: 1\ntimestamp: 2026-05-02T10-00-00Z\n---\nbody\n');
|
||||
write('.impeccable/critique/ignore.md', '# Critique ignores\n');
|
||||
write('.impeccable/critique/9999-not-a-snapshot.md', '# Draft\n');
|
||||
const s = await gatherSignals(scratch);
|
||||
assert.equal(s.critique.latest.slug, 'pricing');
|
||||
assert.equal(s.critique.latest.score, 9);
|
||||
assert.equal(
|
||||
s.critique.latest.file,
|
||||
'.impeccable/critique/2026-05-02T10-00-00Z__pricing.md',
|
||||
);
|
||||
});
|
||||
|
||||
it('handles a non-git dir without throwing', async () => {
|
||||
const s = await gatherSignals(scratch);
|
||||
assert.equal(s.git.isRepo, false);
|
||||
|
||||
Reference in New Issue
Block a user