Files
ai-news-writer/docs
Paperclip Agent 50ed210353
ai-news-writer-ci / test (pull_request) Failing after 38s
docs(secrets): align SECRETS_MANAGEMENT precedence with secrets.js
PR #15 (commit 0ab7e7e) fixed the merge-order comment inside
src/config/secrets.js but the standalone docs/SECRETS_MANAGEMENT.md
still claimed the inverse precedence (system file > .env > process.env),
which contradicts the runtime where SecretsManager.load() applies
process.env then /etc/ai-news-writer/secrets.env then the repo .env so
the last assignment wins.

Changes:
- Update docs/SECRETS_MANAGEMENT.md to reflect the true precedence
  (.env > /etc/ai-news-writer/secrets.env > process.env) plus a
  production-safety note explaining why .env must not exist on
  deployed hosts and how lxc-secrets-inject.sh enforces that.
- Add a load() precedence test in src/config/secrets.test.js that
  stubs fs.existsSync/fs.readFileSync to exercise the singleton end
  to end, locking the contract so future refactors fail loudly if the
  merge order changes without a docs update.

Closes the documentation drift left over from BIT-4294 PR #15. The
runtime semantics are unchanged.

Paperclip-Agent: David Santos (id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376)
Paperclip-Issue: BIT-4294
Paperclip-Run: d5bfe2e3-56d0-418f-a8fd-80817aaa40f2
2026-05-09 01:11:45 +00:00
..