Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Fail closed on incomplete prompt history checks (#12222)

Adam Eivy6080007654f2
diff --git a/scripts/ci-base-sha.test.js b/scripts/ci-base-sha.test.js
index dffb5e0560..f83768dcb3 100644
--- a/scripts/ci-base-sha.test.js
+++ b/scripts/ci-base-sha.test.js
@@ -48,7 +48,8 @@ describe('ci.yml checkout depth', () => {
const jobs = workflowJobs(WORKFLOW);
it('fetches full history only for the shipped prompt guard', () => {
- const jobs = workflowJobs(WORKFLOW);
+ expect(Object.keys(jobs).length).toBeGreaterThan(0);
+ expect(jobs['prompt-history']).toBeDefined();
expect(jobs['prompt-history']).toMatch(/fetch-depth:\s*0\b/);
for (const [id, body] of Object.entries(jobs)) {
if (id !== 'prompt-history') expect(body, id).not.toMatch(/fetch-depth:\s*0\b/);
diff --git a/scripts/migrations/check-shipped-prompt-history.js b/scripts/migrations/check-shipped-prompt-history.js
index 9fb3f5d2cf..969a288c7b 100644
--- a/scripts/migrations/check-shipped-prompt-history.js
+++ b/scripts/migrations/check-shipped-prompt-history.js
@@ -12,13 +12,15 @@ const result = await inspectShippedPromptHistory({
});
if (result.skipped) {
- console.log(
- `⏭️ Skipping shipped stage-prompt history guard: ${result.skipped}`,
- );
- process.exit(0);
-}
-
-if (result.stranded.length) {
+ const inCi = process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true';
+ if (inCi) {
+ console.error(`❌ Shipped stage-prompt history guard requires full git history in CI: ${result.skipped}`);
+ process.exitCode = 1;
+ } else {
+ console.log(`⏭️ Skipping shipped stage-prompt history guard: ${result.skipped}`);
+ process.exit(0);
+ }
+} else if (result.stranded.length) {
for (const { file, hash, commit } of result.stranded) {
console.error(
`❌ ${file}: historical hash ${hash} from ${commit.slice(0, 12)} is not accepted by a prompt migration`,