docs(secrets): BIT-4294 — align SECRETS_MANAGEMENT precedence with secrets.js #17

Merged
spark merged 2 commits from task/BIT-4294-secrets-doc-precedence into main 2026-05-09 12:22:29 +01:00
2 Commits
Author SHA1 Message Date
Paperclip Agent c340d41f19 chore(deps): fix npm audit high (fast-xml-builder)
ai-news-writer-ci / test (pull_request) Successful in 1m11s
Resolves transitive advisory so `npm audit --audit-level=high` passes in
Gitea Actions; unblocks merge of PR #17 (secrets doc + precedence test).

Paperclip-Issue: BIT-4602
Paperclip-Run: 8225f565-2ac5-41fb-abb0-65b6ae6bf099
2026-05-09 11:21:11 +00:00
Paperclip Agent 50ed210353 docs(secrets): align SECRETS_MANAGEMENT precedence with secrets.js
ai-news-writer-ci / test (pull_request) Failing after 38s
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