ReviewOS

also looking at this

stacks/drone

docs: align update acceptance with protected preparation

#48
Merged chris wants to merge codex/docs-update-preparation-status into main
27 files +1676 -74
app/Commands/UpdatesRefresh.tsadded+17-0
Changes to app/Commands/UpdatesRefresh.ts
@@ -0,0 +1,17 @@
1import { defineCommand } from '@stacksjs/cli'
2import { printAsync } from '../../resources/functions/cli/output'
3import { storeCommandFailure, storeCommandReference, storeReferenceFlags } from '../../resources/functions/drone/updates/command'
4import { refreshRuntimeTrustStore } from '../../resources/functions/drone/updates/store'
5
6export default defineCommand({
7 name: 'updates:refresh <directory>',
8 description: 'Verify offline metadata at an independently trusted system time and retain its accepted prefix',
9 options: { ...storeReferenceFlags, '--repository <path>': 'Bounded offline metadata repository', '--trusted-system-clock-source <name>': 'Audit label for the independently managed trusted system clock, not an attestation' },
10 async handle(options, directory) {
11 try {
12 if (typeof options.repository !== 'string' || typeof options.trustedSystemClockSource !== 'string') throw new Error('Explicit repository and independently trusted system-clock source required')
13 await printAsync(JSON.stringify(await refreshRuntimeTrustStore({ ...storeCommandReference(options, directory), repository: options.repository, clock: { source: options.trustedSystemClockSource, read: () => new Date() } })))
14 }
15 catch { await storeCommandFailure() }
16 },
17})