Skip to content

features.ndc_compression is documented but read nowhere — setting it false does nothing #159

Closed

Description

@fdaviddpt

Description

features.ndc_compression is documented in the README as a supported option, but the string appears nowhere in the code. Setting it to false has no effect: NDC compression runs anyway.

$ grep -rn "ndc_compression" scripts/ pipeline/ config.json README.md
README.md:223:| `features.ndc_compression` | `true` | Enable hourly compression of daily files |

One documented row, zero readers.

Reproduction

  1. Set "features": {"ndc_compression": false} in the config.
  2. Run a save that produces an entry.
  3. Watch the log.
[write] appended: ## 23:41 | main
[ndc] now.md → today-2026-07-25.md
[ndc] running (PID 86806)

Compression runs regardless. The only thing that actually holds it back is the tmp/last-ndc.ts cooldown marker together with cooldowns.ndc_seconds — scripts/save-session.sh Step 8 gates on the marker alone and never consults the feature flag.

Why it matters

Someone who wants their now.md left alone — to read it raw, to debug what the summarizer is producing, or because they run their own compression — sets the documented option, sees it ignored, and has no signal as to why. The workaround (a far-future ndc_seconds plus a hand-written marker file) is not discoverable from the docs.

It also makes tests around save output awkward: anything asserting on now.md contents has to defeat the background compression by hand, since the documented brake does nothing.

Suggested fix

Gate Step 8 on the flag alongside the cooldown, matching the existing config ".key" default pattern used elsewhere in the script:

if [ "$(config '.features.ndc_compression' true)" != "true" ]; then
    RUN_NDC=false
fi

Defaults to true, so nothing changes for anyone who has not set it.

Worth a test that sets the flag to false and asserts no [ndc] line is logged — the failure mode here is silence, which is how it went unnoticed.

Notes

Found while writing tests for #136: a test asserting a rejected entry never reached memory passed against unfixed code, because compression had already moved the junk out of now.md and into today-*.md. The flag was set to false in that fixture and did nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions