Skip to content

generate-pdf.mjs and set-status.mjs ignore the .career-ops-data marker #4389

Description

@Alox2k

Version: v1.33.0 (commit 29820aa), macOS, Node

What happens

With user data outside the repo and a .career-ops-data marker pointing at it (.. in my case), most scripts resolve the data root correctly. doctor.mjs reports it, and getCareerOpsRoot() returns the data directory. Two scripts still look inside the code directory:

  1. generate-pdf.mjs refuses to write the PDF:

    Refusing to write the PDF outside the tracker workspace: input escapes the tracker workspace:
    /path/to/data/output/cv.html (workspaceRoot=/path/to/data/career-ops ...)
    

    refreshRootCache() (line 72) derives the workspace from resolveTrackerPath(__dirname), so the marker is never read. The module-level trackerPath at line 48 does use getCareerOpsRoot(), so the two disagree.

  2. set-status.mjs can't find the tracker:

    ❌ No tracker found at /path/to/data/career-ops/applications.md
    

    Line 328: const APPS_FILE = resolveTrackerPath(CAREER_OPS), where CAREER_OPS is the script's own directory.

Workaround

Setting CAREER_OPS_TRACKER=/path/to/data/data/applications.md makes both work, since they honour that variable.

Steps to reproduce

  1. Put the user layer in a separate directory and create .career-ops-data in the repo root pointing at it.
  2. node doctor.mjs --json: data root resolves correctly.
  3. node generate-pdf.mjs <data>/output/x.html <data>/output/x.pdf: refused.
  4. node set-status.mjs --report 3 Evaluated --dry-run: "No tracker found".

Suggested fix

Use resolveTrackerPath(getCareerOpsRoot()) in both places, the same as the other scripts.

Possibly affected (not verified)

A grep for resolveTrackerPath( with a script-directory argument also matches these files. I haven't tested them, so some may be false positives: dedup-tracker.mjs, followup-cadence.mjs, hired-share.mjs, invite-match.mjs, mark-pdf-ready.mjs, normalize-statuses.mjs, outcome.mjs, reply-watch.mjs, tracker-utils.mjs, tracker.mjs, upskill.mjs, verify-pipeline.mjs. A test that runs each tracker-writing script with only a marker (and no CAREER_OPS_TRACKER) would catch the whole class.

Small related note

generate-pdf.mjs injects its own @page { margin: var(--page-margin, 0.6in) } after the document's styles, so a hand-written CV's own @page margin is silently ignored. Documenting --page-margin in modes/pdf.md would save people a debugging round.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions