shraga 0.1.92 → 0.1.93
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 +1 -1
- package/src/server/data-sync.ts +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shraga",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.93",
|
|
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",
|
package/src/server/data-sync.ts
CHANGED
|
@@ -224,14 +224,20 @@ export class DataSync {
|
|
|
224
224
|
private runIntegrityAudit(): void {
|
|
225
225
|
try {
|
|
226
226
|
const { audit } = require('./integrity-audit.ts');
|
|
227
|
-
|
|
227
|
+
// Churn paths are exempt for the same reason the shrink guard exempts them: a per-run worker
|
|
228
|
+
// log is written by one leg, rewritten by the next, and truncated whenever a run is killed
|
|
229
|
+
// mid-write. "invalid-json" on one of those is the normal end of an interrupted run, not
|
|
230
|
+
// corruption of shared data — and since the file stays in HEAD, the audit re-reported it on
|
|
231
|
+
// every sync. The audit exists to catch contacts.json being gutted.
|
|
232
|
+
const issues = (audit('HEAD~1') as { kind: string; file: string; detail: string }[])
|
|
233
|
+
.filter(i => !isChurnPath(i.file));
|
|
228
234
|
if (issues.length) {
|
|
229
235
|
console.warn(`${TAG} ⚠️ DATA INTEGRITY: ${issues.length} issue(s) detected after sync:`);
|
|
230
236
|
for (const { kind, file, detail } of issues) {
|
|
231
237
|
console.warn(`${TAG} ${kind} ${file} — ${detail}`);
|
|
232
238
|
}
|
|
233
239
|
const list = issues.slice(0, 20).map(i => `• [${i.kind}] ${i.file} — ${i.detail}`).join('\n');
|
|
234
|
-
this.
|
|
240
|
+
this.alertOnce('integrity', issues.map(i => `${i.kind} ${i.file}`).join('\n'),
|
|
235
241
|
`⚠️ Data integrity: ${issues.length} issue(s) detected after sync\n\n${list}` +
|
|
236
242
|
(issues.length > 20 ? `\n…and ${issues.length - 20} more` : '') +
|
|
237
243
|
`\n\nRecover: \`cd data && git revert HEAD\``,
|