Add news digest --no-push
Rebuilds the day's digest and its prose in place after a settings change, without sending a second pointer for a day already pushed. Deliberately a flag on the real command rather than a script beside it. A tuning path that diverges from the production path is what made the old system's replay harness worthless, and rebuilding today's digest by hand would have been exactly that divergence. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xPLgmcXCc9JjVwmQF63eM
This commit is contained in:
1 parent
da6bf4fd8d
commit
17fc887500
1 file changed
+10
+10
@@ -260,6 +260,14 @@ def cmd_digest(args) -> int:
|
|||||||
ntfy = NtfyConfig.from_env()
|
ntfy = NtfyConfig.from_env()
|
||||||
base = ntfy.api_base or ""
|
base = ntfy.api_base or ""
|
||||||
link = f"{base}/digest/{day}"
|
link = f"{base}/digest/{day}"
|
||||||
|
if args.no_push and not args.dry_run:
|
||||||
|
# Rebuild today's digest in place after a settings change, without
|
||||||
|
# sending a second pointer for a day already pushed. Deliberately
|
||||||
|
# the same code path as the scheduled run rather than a script
|
||||||
|
# beside it: a tuning path that diverges from the production path
|
||||||
|
# is what made the old system's replay harness worthless.
|
||||||
|
print(f"digest rebuilt, not pushed -> {link}")
|
||||||
|
return 0
|
||||||
if args.dry_run:
|
if args.dry_run:
|
||||||
print(f"[dry-run] push: {title}\n{body}\n-> {link}")
|
print(f"[dry-run] push: {title}\n{body}\n-> {link}")
|
||||||
for i in items[:8]:
|
for i in items[:8]:
|
||||||
@@ -308,6 +316,8 @@ def main(argv: list[str] | None = None) -> int:
|
|||||||
|
|
||||||
p = sub.add_parser("digest", help="build the digest and push a pointer to it")
|
p = sub.add_parser("digest", help="build the digest and push a pointer to it")
|
||||||
p.add_argument("--dry-run", action="store_true")
|
p.add_argument("--dry-run", action="store_true")
|
||||||
|
p.add_argument("--no-push", action="store_true",
|
||||||
|
help="rebuild the digest and its prose without sending ntfy")
|
||||||
p.set_defaults(fn=cmd_digest)
|
p.set_defaults(fn=cmd_digest)
|
||||||
|
|
||||||
p = sub.add_parser("serve", help="run the web server")
|
p = sub.add_parser("serve", help="run the web server")
|
||||||
|
|||||||
Reference in new issue
Block a user