shraga 0.1.92 → 0.1.94

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shraga",
3
- "version": "0.1.92",
3
+ "version": "0.1.94",
4
4
  "description": "The teammate you delegate coding to — a self-hostable, multi-user AI coding agent web UI (Claude Code, with a pluggable engine seam).",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -72,7 +72,13 @@ export function extractCommitSubject(raw: string): string {
72
72
  * guard aborts the WHOLE commit, so one churn file stalls every other file's sync indefinitely —
73
73
  * measured 2026-09-07: repeated BLOCKED alerts and a 27-commit push backlog behind two task files. */
74
74
  export function isChurnPath(file: string): boolean {
75
- return /(^|\/)workspace\/[^/]+\/workers\/(logs|tasks)\//.test(file) || /\.bak(-|\.|$)/.test(file);
75
+ return /(^|\/)workspace\/[^/]+\/workers\/(logs|tasks)\//.test(file)
76
+ // Per-job runtime records (one .json/.log/.status triple per background job), written on
77
+ // dispatch and garbage-collected once the job is done. 54 live files churning constantly, so
78
+ // their deletion is the design, not a regression — the integrity audit reported dozens of
79
+ // "missing … in reference but not HEAD" lines for a routine GC pass.
80
+ || /(^|\/)jobs\/job-[^/]+\.(json|log|status)$/.test(file)
81
+ || /\.bak(-|\.|$)/.test(file);
76
82
  }
77
83
 
78
84
  export class DataSyncOptions {
@@ -224,14 +230,20 @@ export class DataSync {
224
230
  private runIntegrityAudit(): void {
225
231
  try {
226
232
  const { audit } = require('./integrity-audit.ts');
227
- const issues = audit('HEAD~1') as { kind: string; file: string; detail: string }[];
233
+ // Churn paths are exempt for the same reason the shrink guard exempts them: a per-run worker
234
+ // log is written by one leg, rewritten by the next, and truncated whenever a run is killed
235
+ // mid-write. "invalid-json" on one of those is the normal end of an interrupted run, not
236
+ // corruption of shared data — and since the file stays in HEAD, the audit re-reported it on
237
+ // every sync. The audit exists to catch contacts.json being gutted.
238
+ const issues = (audit('HEAD~1') as { kind: string; file: string; detail: string }[])
239
+ .filter(i => !isChurnPath(i.file));
228
240
  if (issues.length) {
229
241
  console.warn(`${TAG} ⚠️ DATA INTEGRITY: ${issues.length} issue(s) detected after sync:`);
230
242
  for (const { kind, file, detail } of issues) {
231
243
  console.warn(`${TAG} ${kind} ${file} — ${detail}`);
232
244
  }
233
245
  const list = issues.slice(0, 20).map(i => `• [${i.kind}] ${i.file} — ${i.detail}`).join('\n');
234
- this.notifyOwners(
246
+ this.alertOnce('integrity', issues.map(i => `${i.kind} ${i.file}`).join('\n'),
235
247
  `⚠️ Data integrity: ${issues.length} issue(s) detected after sync\n\n${list}` +
236
248
  (issues.length > 20 ? `\n…and ${issues.length - 20} more` : '') +
237
249
  `\n\nRecover: \`cd data && git revert HEAD\``,