# SPDX-License-Identifier: AGPL-3.0-or-later """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" "Forecast and remediation timeline below. Numbers are\n" "preliminary and subject to revision before the all-hands.
\n" "| Region | Incidents | MTTR (h) |
|---|---|---|
| us-east | 14 | 3.2 |
| us-west | 9 | 4.7 |
| eu-central | 22 | 2.1 |
Internal contact: " "secops@internal
\n" f"