"""Built-in honeydoc — a minimal HTML "report" with a tracking pixel. This is the *fallback* honeydoc used when the operator hasn't uploaded a real document. The HTML instrumenter handles operator uploads via :mod:`decnet.canary.instrumenters.html`; this generator exists so the deploy-time baseline can plant *something* convincing without first prompting the operator to drop a file. The realism here is intentionally modest: a Documents-folder HTML page with internal-looking content and a 1×1 remote image at the bottom whose ``src`` is the canary callback URL. Most desktop HTML renderers fetch the image as soon as the file is opened in a browser preview, so opening the doc trips the callback. Operators who want a richer artifact should upload their own DOCX or PDF; the corresponding instrumenter embeds the same callback in the appropriate format. """ from __future__ import annotations from decnet.canary.base import CanaryArtifact, CanaryContext, CanaryGenerator class HoneydocGenerator(CanaryGenerator): name = "honeydoc" def generate(self, ctx: CanaryContext) -> CanaryArtifact: base = ctx.http_base.rstrip("/") slug = ctx.callback_token pixel_url = f"{base}/c/{slug}" body = ( "\n" "\n" "\n" "\n" "Q3 Operations Review — DRAFT\n" "\n" "\n" "

Q3 Operations Review (DRAFT — DO NOT DISTRIBUTE)

\n" "

Forecast and remediation timeline below. Numbers are\n" "preliminary and subject to revision before the all-hands.

\n" "\n" "\n" "\n" "\n" "\n" "
RegionIncidentsMTTR (h)
us-east143.2
us-west94.7
eu-central222.1
\n" "

Internal contact: " "secops@internal

\n" f"\"\"\n" "\n" "\n" ) return CanaryArtifact( path="", content=body.encode("utf-8"), mode=0o644, # docs are typically world-readable mtime_offset=-86400 * 21, # 3 weeks ago generator=self.name, notes=[f"tracking pixel src={pixel_url}"], )