Skip to content

fix(updater): add missing language modes and scripts to SYSTEM_PATHS …#353

Open
darshan3131 wants to merge 3 commits intosantifer:mainfrom
darshan3131:fix/337-system-paths
Open

fix(updater): add missing language modes and scripts to SYSTEM_PATHS …#353
darshan3131 wants to merge 3 commits intosantifer:mainfrom
darshan3131:fix/337-system-paths

Conversation

@darshan3131
Copy link
Copy Markdown
Contributor

@darshan3131 darshan3131 commented Apr 17, 2026

…(#337)

SYSTEM_PATHS only listed modes/de/ and a subset of root scripts. It silently skipped modes/fr, modes/ja, modes/pt, modes/ru and newer mode files (patterns, followup, interview-prep), plus root scripts shipped since v1.0: scan.mjs, check-liveness.mjs, liveness-core.mjs, analyze-patterns.mjs, followup-cadence.mjs, doctor.mjs, test-all.mjs.

As a result, 'npm run update' never pulled these files on user installs — any fix to them was dead on arrival.

Added all missing paths. User-layer paths are unchanged.

What does this PR do?

Related issue

Type of change

  • Bug fix
  • New feature
  • Documentation / translation
  • Refactor (no behavior change)

Checklist

  • I have read CONTRIBUTING.md
  • I linked a related issue above (required for features and architecture changes)
  • My PR does not include personal data (CV, email, real names)
  • I ran node test-all.mjs and all tests pass
  • My changes respect the Data Contract (no modifications to user-layer files)
  • My changes align with the project roadmap

Questions? Join the Discord for faster feedback.

Summary by CodeRabbit

  • Chores
    • Added localized mode documentation support in French, Japanese, Portuguese, and Russian.
    • Expanded system update and rollback operations to include additional utility scripts for scanning, diagnostics, pattern analysis, liveness monitoring, and testing functions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

📝 Walkthrough

Walkthrough

The PR expands the SYSTEM_PATHS allowlist in update-system.mjs to include additional mode documentation files (patterns.md, followup.md, interview-prep.md) and localized mode directories (French, Japanese, Portuguese, Russian). It also adds seven system scripts to the updatable scripts list, enabling these paths to be managed during update and rollback operations.

Changes

Cohort / File(s) Summary
System Paths Configuration
update-system.mjs
Expanded SYSTEM_PATHS allowlist with three additional mode documents and four localized mode directories. Added seven system scripts (scan.mjs, check-liveness.mjs, liveness-core.mjs, analyze-patterns.mjs, followup-cadence.mjs, doctor.mjs, test-all.mjs) to updatable scripts.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • Issue #337: Directly addresses the same SYSTEM_PATHS omissions by adding missing localized mode directories and root scripts to the allowlist.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding missing language modes and scripts to SYSTEM_PATHS, which is the core purpose of this PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to career-ops, @darshan3131! Thanks for your first PR.

A few things to know:

  • Tests will run automatically — check the status below
  • Make sure you've linked a related issue (required for features)
  • Read CONTRIBUTING.md if you haven't

We'll review your PR soon. Join our Discord if you have questions.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
DATA_CONTRACT.md (1)

44-51: ⚠️ Potential issue | 🟡 Minor

Missing modes/interview-prep.md entry.

update-system.mjs adds modes/interview-prep.md to SYSTEM_PATHS, but the System Layer table here only lists modes/patterns.md and modes/followup.md. Since this PR is explicitly about reconciling the updater allowlist with the documented system/user boundary, please also document modes/interview-prep.md here so the contract matches the updater.

Note: this is the file modes/interview-prep.md, distinct from the user-layer interview-prep/story-bank.md already listed above.

📝 Proposed addition
 | `modes/patterns.md` | Pattern analysis instructions |
 | `modes/followup.md` | Follow-up cadence instructions |
+| `modes/interview-prep.md` | Interview prep instructions |
 | `modes/de/*` | German language modes |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@DATA_CONTRACT.md` around lines 44 - 51, The System Layer table in
DATA_CONTRACT.md is missing an entry for modes/interview-prep.md even though
update-system.mjs adds it to SYSTEM_PATHS; update the System Layer table to
include a row for `modes/interview-prep.md` with a short description like
"Interview preparation instructions" so the documented contract matches the
updater allowlist (refer to update-system.mjs and the SYSTEM_PATHS constant to
confirm the file name).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@merge-tracker.mjs`:
- Around line 76-95: ROLE_STOPWORDS contains duplicate 'intern' and an
aggressive location/region block that can over-filter legitimate role/company
signals; update ROLE_STOPWORDS to remove duplicates and consider removing or
pruning the city/region entries (or move them to portals.yml) and then modify
the tokenization in roleTokens (the length filter) to allow short domain tokens
by changing the length check from >3 to >=2 or by introducing a shortToken
allowlist (e.g., ['ai','ml','pm','se','eng','sa']) so tokens like "AI", "PM",
etc. are preserved; ensure roleFuzzyMatch still gets non-empty tokens and keep
company matching responsibility in normalizeCompany so you don't need broad
location stopwords for deduplication.

---

Outside diff comments:
In `@DATA_CONTRACT.md`:
- Around line 44-51: The System Layer table in DATA_CONTRACT.md is missing an
entry for modes/interview-prep.md even though update-system.mjs adds it to
SYSTEM_PATHS; update the System Layer table to include a row for
`modes/interview-prep.md` with a short description like "Interview preparation
instructions" so the documented contract matches the updater allowlist (refer to
update-system.mjs and the SYSTEM_PATHS constant to confirm the file name).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b5a7a8c0-267d-422f-a827-ecce53504fe0

📥 Commits

Reviewing files that changed from the base of the PR and between 5f36eff and f2b1ffa.

📒 Files selected for processing (6)
  • DATA_CONTRACT.md
  • VERSION
  • merge-tracker.mjs
  • modes/scan.md
  • package.json
  • update-system.mjs

Comment thread merge-tracker.mjs Outdated
Comment on lines +76 to +95
const ROLE_STOPWORDS = new Set([
// seniority / level
'junior', 'mid', 'middle', 'senior', 'staff', 'principal', 'lead', 'head',
'chief', 'associate', 'intern', 'entry', 'level',
// contract / mode
'remote', 'hybrid', 'onsite', 'contract', 'contractor', 'freelance',
'fulltime', 'parttime', 'permanent', 'temporary', 'intern', 'internship',
// generic job words
'role', 'position', 'opportunity', 'team', 'based',
// very common locations (extend in portals.yml later if needed)
'bangalore', 'bengaluru', 'mumbai', 'delhi', 'hyderabad', 'pune', 'chennai',
'london', 'berlin', 'paris', 'madrid', 'barcelona', 'amsterdam', 'dublin',
'york', 'francisco', 'seattle', 'boston', 'austin', 'chicago', 'toronto',
'tokyo', 'singapore', 'sydney', 'melbourne', 'lisbon', 'warsaw',
// regions / countries
'europe', 'emea', 'apac', 'latam', 'americas', 'india', 'spain', 'germany',
'france', 'italy', 'canada', 'brazil', 'mexico', 'japan',
// prepositions leaking through length filter
'with', 'from', 'into', 'over', 'this', 'that',
]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Stopword list risks over-filtering legitimate role signal.

A few concerns worth verifying before release:

  1. 'intern' is listed twice (lines 79 and 82). Harmless in a Set, but indicates the list wasn't reviewed carefully.
  2. Dropping single city tokens like 'york', 'francisco', 'boston', 'paris' is intentional for location-in-title cases, but this also strips company/product-family signals if a role string contains them for legitimate reasons. Given the length filter already requires >3 chars and company is matched separately via normalizeCompany, you may not need the location/region block at all for dedup.
  3. The combined length > 3 + stopword filter can drop roles down to 0 or 1 tokens (e.g. "AI PM Remote"[] because ai/pm fail the length filter and remote is a stopword). roleTokens then returns [], so roleFuzzyMatch returns false and the duplicate is silently missed. Consider lowering the length filter to >=2 or keeping short domain tokens (ai, ml, pm, sa, se, eng) on an allowlist.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@merge-tracker.mjs` around lines 76 - 95, ROLE_STOPWORDS contains duplicate
'intern' and an aggressive location/region block that can over-filter legitimate
role/company signals; update ROLE_STOPWORDS to remove duplicates and consider
removing or pruning the city/region entries (or move them to portals.yml) and
then modify the tokenization in roleTokens (the length filter) to allow short
domain tokens by changing the length check from >3 to >=2 or by introducing a
shortToken allowlist (e.g., ['ai','ml','pm','se','eng','sa']) so tokens like
"AI", "PM", etc. are preserved; ensure roleFuzzyMatch still gets non-empty
tokens and keep company matching responsibility in normalizeCompany so you don't
need broad location stopwords for deduplication.

…antifer#337)

SYSTEM_PATHS only listed modes/de/ and a subset of root scripts.
It silently skipped modes/fr, modes/ja, modes/pt, modes/ru and newer
mode files (patterns, followup, interview-prep), plus root scripts
shipped since v1.0: scan.mjs, check-liveness.mjs, liveness-core.mjs,
analyze-patterns.mjs, followup-cadence.mjs, doctor.mjs, test-all.mjs.

As a result, 'npm run update' never pulled these files on user
installs — any fix to them was dead on arrival.

Added all missing paths. User-layer paths are unchanged.
@darshan3131 darshan3131 force-pushed the fix/337-system-paths branch from 5f36eff to 1854c7d Compare April 18, 2026 07:21
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
update-system.mjs (1)

305-313: ⚠️ Potential issue | 🟡 Minor

Rollback amplifies a pre-existing git add hazard for newly listed paths.

rollback() calls addPaths(SYSTEM_PATHS) unconditionally (Line 313), unlike apply() which only stages successfully-updated paths. For users rolling back from a version that never had modes/fr/, modes/ja/, modes/pt/, modes/ru/, scan.mjs, check-liveness.mjs, etc. locally, the per-path checkout on Line 307 silently fails and the path remains absent — then git add -- modes/ru/ will fail with "did not match any files", aborting the rollback commit and leaving the repo in a partially-restored state.

This PR doesn't introduce the pattern, but it materially widens its blast radius since the new entries are exactly the ones most likely to be missing on older installs.

♻️ Suggested fix: mirror apply()'s pattern and only stage paths that actually restored
     const latest = branchList[0];
     console.log(`Rolling back to: ${latest}`);
 
     // Checkout system files from backup branch
+    const restored = [];
     for (const path of SYSTEM_PATHS) {
       try {
         git('checkout', latest, '--', path);
+        restored.push(path);
       } catch {
         // File may not have existed in backup
       }
     }
 
-    addPaths(SYSTEM_PATHS);
+    addPaths(restored);
     git('commit', '-m', `chore: rollback system files from ${latest}`);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@update-system.mjs` around lines 305 - 313, The rollback() function
unconditionally calls addPaths(SYSTEM_PATHS) which reintroduces the "git add"
failure when per-path git checkout silently skipped missing files; change
rollback() to mirror apply() by tracking which paths actually restored (e.g.,
after each git('checkout', latest, '--', path) inside the try block push path
into a restoredPaths array) and then call addPaths(restoredPaths) instead of
addPaths(SYSTEM_PATHS), ensuring only successfully-checked-out paths are staged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@update-system.mjs`:
- Around line 305-313: The rollback() function unconditionally calls
addPaths(SYSTEM_PATHS) which reintroduces the "git add" failure when per-path
git checkout silently skipped missing files; change rollback() to mirror apply()
by tracking which paths actually restored (e.g., after each git('checkout',
latest, '--', path) inside the try block push path into a restoredPaths array)
and then call addPaths(restoredPaths) instead of addPaths(SYSTEM_PATHS),
ensuring only successfully-checked-out paths are staged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 72e6ddb9-52b4-4b67-a758-841a3d7b4801

📥 Commits

Reviewing files that changed from the base of the PR and between f2b1ffa and 1854c7d.

📒 Files selected for processing (1)
  • update-system.mjs

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant