yam-flow 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -137,6 +137,14 @@ export interface RuntimeBackendEvidence {
137
137
  evidence_id: string;
138
138
  command: string;
139
139
  cleanup_checked: boolean;
140
+ started_at: string;
141
+ stopped_at: string;
142
+ exit_code: number | null;
143
+ pid: number | null;
144
+ port: number | null;
145
+ cleanup_method: string;
146
+ cleanup_observed: boolean;
147
+ left_running_intentionally: boolean;
140
148
  note: string;
141
149
  truth_status: TruthStatus;
142
150
  }
@@ -409,6 +417,13 @@ export function buildMissionPatchEnvelope(input: Partial<MissionPatchEnvelope> =
409
417
  export function buildRuntimeBackendEvidence(input: Partial<RuntimeBackendEvidence> = {}): RuntimeBackendEvidence {
410
418
  const backend = normalizeRuntimeBackend(input.backend);
411
419
  const claim = normalizeRuntimeClaim(input.claim);
420
+ const cleanupObserved = Boolean(input.cleanup_observed);
421
+ const leftRunningIntentionally = Boolean(input.left_running_intentionally);
422
+ const exitCode = numberOrNull(input.exit_code);
423
+ const pid = numberOrNull(input.pid);
424
+ const port = numberOrNull(input.port);
425
+ const stoppedAt = String(input.stopped_at || '');
426
+ const cleanupMethod = String(input.cleanup_method || '');
412
427
  return {
413
428
  schema: 'yam.runtime-backend-evidence.v1',
414
429
  backend,
@@ -416,8 +431,24 @@ export function buildRuntimeBackendEvidence(input: Partial<RuntimeBackendEvidenc
416
431
  evidence_id: String(input.evidence_id || ''),
417
432
  command: String(input.command || ''),
418
433
  cleanup_checked: Boolean(input.cleanup_checked),
434
+ started_at: String(input.started_at || ''),
435
+ stopped_at: stoppedAt,
436
+ exit_code: exitCode,
437
+ pid,
438
+ port,
439
+ cleanup_method: cleanupMethod,
440
+ cleanup_observed: cleanupObserved,
441
+ left_running_intentionally: leftRunningIntentionally,
419
442
  note: String(input.note || ''),
420
- truth_status: isTruthStatus(input.truth_status) ? input.truth_status : runtimeBackendTruth(backend, claim, Boolean(input.cleanup_checked))
443
+ truth_status: isTruthStatus(input.truth_status) ? input.truth_status : runtimeBackendTruth(backend, claim, {
444
+ cleanupChecked: Boolean(input.cleanup_checked),
445
+ cleanupObserved,
446
+ leftRunningIntentionally,
447
+ stoppedAt,
448
+ exitCode,
449
+ pid,
450
+ cleanupMethod
451
+ })
421
452
  };
422
453
  }
423
454
 
@@ -834,11 +865,24 @@ function normalizeRuntimeClaim(value: unknown = ''): RuntimeClaim {
834
865
  return 'unknown';
835
866
  }
836
867
 
837
- function runtimeBackendTruth(backend: RuntimeBackend, claim: RuntimeClaim, cleanupChecked = false): TruthStatus {
868
+ function runtimeBackendTruth(backend: RuntimeBackend, claim: RuntimeClaim, details: {
869
+ cleanupChecked?: boolean;
870
+ cleanupObserved?: boolean;
871
+ leftRunningIntentionally?: boolean;
872
+ stoppedAt?: string;
873
+ exitCode?: number | null;
874
+ pid?: number | null;
875
+ cleanupMethod?: string;
876
+ } = {}): TruthStatus {
838
877
  if (claim === 'blocked') return 'blocked';
839
878
  if (backend === 'none' || claim === 'not_started') return 'skipped';
840
879
  if (backend === 'unknown' || claim === 'unknown') return 'partial';
841
- if (claim === 'cleanup_verified' || cleanupChecked) return 'proven';
880
+ const hasClosureEvidence = Boolean(details.stoppedAt || details.exitCode !== null || details.cleanupMethod);
881
+ if (claim === 'cleanup_verified' || details.cleanupChecked) {
882
+ if (details.cleanupObserved && hasClosureEvidence) return 'proven';
883
+ if (details.leftRunningIntentionally && (details.pid !== null || details.cleanupMethod)) return 'partial';
884
+ return 'real_required_missing';
885
+ }
842
886
  if (claim === 'observed' || claim === 'stopped' || claim === 'started') return 'verified';
843
887
  return 'partial';
844
888
  }
@@ -46,6 +46,20 @@
46
46
  - Risky changes:
47
47
  - Public/release changes: scan for external tool names, comparison wording, and attribution wording; remove those hits unless the user explicitly approves keeping them.
48
48
 
49
+ ## Security Policy
50
+
51
+ - Sensitive surfaces:
52
+ - Secrets/env handling:
53
+ - Auth/payment/DB policy:
54
+ - Deployment/release policy:
55
+ - Package/dependency policy:
56
+
57
+ ## Report Policy
58
+
59
+ - Explain changed code in plain language:
60
+ - Always include remaining tasks or useful improvements:
61
+ - Preserve source boundaries for research/proof notes:
62
+
49
63
  ## Known Risks
50
64
 
51
65
  - Auth/payment/DB/security: