#4539·career-ops

hired-share and intake silently reset their state files, erasing every "never" answer

Author: abankar1Created Sep 28, 2026Updated Sep 28, 2026
Labelsbug🔧 scripts

Summary

Two user-state files answer an unreadable file the same way they answer an absent one — with an empty object. The next write then persists that emptiness, so the loss is permanent. In hired-share.mjs that erases every "never" answer, which breaks an absolute rule in AGENTS.md.

1. hired-share.mjs — the anti-nag memory erases itself

data/.hired-share-state.json is, in the file's own comment, "the entire anti-nag memory": which hires the user was asked about sharing on the Hired Wall, and which they said never to bring up again.

javascript
function loadState(root) {
  const p = statePath(root);
  if (!existsSync(p)) return { byReport: {} };
  try { return JSON.parse(readFileSync(p, 'utf8')); } catch { return { byReport: {} }; }
}
function saveState(root, s) { writeFileSync(statePath(root), JSON.stringify(s, null, 2) + '\n'); }

The catch cannot tell "this file is damaged" from "this is a first run", and it answers both with an empty memory. The next saveState writes that empty memory over the file, so a single unparseable byte makes every recorded answer unrecoverable.

AGENTS.md states the rule this breaks without qualification:

If they say no: --mark never, and honor it — that hire is never brought up again.

and

Cadence rules (hard): one ask per hire, at outcome time. … Never remind on a schedule.

After a reset, --status reports every declined hire as never-asked and lists it in askable, so the agent asks the user to share a hire they already said no to. Nothing surfaces that anything was lost.

saveState is what manufactures the corruption it then hides. writeFileSync truncates before it writes, so an interrupt — Ctrl-C, a full disk, a crash — leaves a half-written file. That file fails to parse on the next run, and the silent reset swallows it. The two halves form a loop: the non-atomic write creates exactly the damage the loader is built to ignore.

2. hired-share.mjs — a root-level tracker makes "never" impossible to record

Separately, saveState writes to {root}/data/.hired-share-state.json without ensuring data/ exists. DATA_CONTRACT.md documents a fallback to a root-level applications.md, and CAREER_OPS_TRACKER may point at any directory, so a workspace whose tracker is not under data/ has no data/ at all:

$ node hired-share.mjs --report 7 --mark never
ENOENT: no such file or directory, open '/…/root/data/.hired-share-state.json'
$ echo $?
1

The user said no, the tool reported a path they never chose, and recorded nothing. On the next run the hire is askable again.

3. intake.mjs — an unreadable ingest ledger re-proposes reviewed documents

data/intake-state.json records which documents in documents/ the user has already reviewed. Same shape:

javascript
function loadState() {
  if (!existsSync(STATE_FILE)) return { ingested: {} };
  try { return JSON.parse(readFileSync(STATE_FILE, 'utf-8')) || { ingested: {} }; }
  catch { return { ingested: {} }; }
}

with a writeFileSync in commitState that can produce the unparseable file. When it resets, computeDelta sees no record for any path and reports every document as new, so intake re-proposes additions the user already reviewed and either accepted or rejected. The human-in-the-loop review is the entire reason the mode exists — AGENTS.md: "nothing is written without the user's explicit confirmation" — and silently re-asking is how a user stops reading the proposals.

One severity below the hired-share case: nothing is written without confirmation, so the cost is wasted review and lost trust rather than a broken promise.

Expected

An existing-but-unreadable state file is not a first run. Both loaders should say so and stop, naming the file, so the user can fix or delete one file knowingly. An absent file must keep meaning a first run — that part is correct today. And the writes that create the damage should be atomic, like every tracker writer already is via writeFileAtomic.

Not in scope

The state files are user layer and gitignored, so there is nothing to migrate: a user with a healthy file sees no change, and a user with a damaged one gets a message instead of silent amnesia.