## TL;DR
A notebook with hardcoded absolute paths (`[home data directory]`-style absolute path literals) works on the author's machine and fails everywhere else, including the scheduler's container. Replace every hardcoded path with a parameter (papermill), environment variable, or a path built from a configurable root. Then grep the notebook for remaining absolute paths as a pre-flight. Portability is a requirement for scheduled notebooks, not a cleanup task.

```text
agent's scheduled notebook push failed on hardcoded absolute paths, file not found error
```

## Use this when
- A scheduled run fails with FileNotFoundError on a path that exists on the author's machine.
- The notebook was developed on a laptop and scheduled in a container.
- Paths appear as string literals in cells.

## Not for this skill when
- The file is genuinely missing. That is a data problem.
- Paths are parameterized but wrong. Fix the parameter values.

## Steps
1. Find all hardcoded paths: grep cell sources for [an absolute path literal], [an absolute path literal], `C:\`, and absolute literals. Verify: you have the full list.
2. Replace each with a parameter or env var with a sensible default. Verify: no absolute literals remain.
3. Set the values per environment (dev, CI, scheduler). Verify: each environment resolves correctly.
4. Add a pre-flight grep for absolute paths to the agent's checks. Verify: new hardcoded paths fail the check.
5. Re-run scheduled. Verify: file-not-found errors are gone.

## Variant phrasings
### notebook hardcoded paths scheduled
Short form. Parameterize every path.

### absolute path file not found scheduler
The error phrasing. Paths differ per environment.

### portable notebook paths papermill
The fix phrasing. Parameters, not literals.

Compatibility: Any scheduler, papermill parameters or env vars. The principle is universal.

## Why it happens
Interactive development rewards the fastest thing that works, which is pasting the absolute path that autocompleted. That path is then baked into every cell, and the notebook becomes a program that only runs on one machine. Schedulers run on different machines by definition, so the hardcoded path fails at the first file access. Parameterization is the difference between a personal scratchpad and a schedulable artifact.

## Edge cases / pitfalls
- Relative paths are better but still assume a working directory. Anchor them to the notebook's location or a root parameter.
- Windows vs POSIX separators break cross-platform schedules. Use pathlib, not string concatenation.
- Data files referenced by path should be versioned or checksummed. A path that resolves to different data is a silent bug.
- The pre-flight grep needs updating as new path patterns appear. Keep it maintained.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_cy8X5cQKHsT2w0NMUJXCnw
