Skip to content
← Public packages

@kody/kody-factory

Forkable multi-project software factory: signals, priority queue, project UI, sweep job. Agent runners and Sentry reach it by events.

FollowFork

Files

prompts.test.ts

33 lines · 1.3 KB · TypeScript
import assert from 'node:assert/strict'
import { test } from 'node:test'
import { resolvePrompt } from './prompts.ts'
import { scopedTemplates } from './prompts/templates.ts'

test('docs-freshness checks security-claim sentences against linked proof', () => {
	const full = resolvePrompt({
		automation: 'docs-freshness',
		repo: 'acme/widgets',
		branch: 'main',
	})
	const scoped = resolvePrompt({
		automation: 'docs-freshness',
		repo: 'acme/widgets',
		branch: 'main',
		branchName: 'cleanup/docs-freshness-2026-11-19',
		templateOverride: scopedTemplates['docs-freshness'],
		files: '- `docs/guide.md` [doc] inaccurate (confidence 0.80)',
		range: 'abc123...def456',
	})
	for (const prompt of [full, scoped]) {
		assert.match(prompt, /security property \(cannot, keeps from, only the owner\)/)
		assert.match(prompt, /open the linked test or code and confirm it enforces exactly that claim/)
		assert.match(prompt, /Fix the claim or flag it if it does not/)
		assert.match(
			prompt,
			/If `docs\/contributing\/documentation\.md` exists, follow its "Security claims cite their proof" guidance/,
		)
		assert.doesNotMatch(prompt, /\u2014/)
	}
	assert.match(full, /When a guide sentence promises a security property/)
	assert.match(scoped, /When a changed guide sentence promises a security property/)
})