# Black Box mkblog Test Findings

Date: 2026-05-19

## Summary

I tested `mkblog` from the documented command-line surface in `README.md`, using only `go run ./cmd/mkblog` and a disposable fixture under `/tmp/mkblog-blackbox`.

Overall result: the core black box scenarios passed. Builds produce pretty URL post pages, blog/tag/archive pages, copied content assets, copied static assets, rendered markdown, rendered shortcodes, hidden direct pages, draft/future filtering, alternate theme output, and a working local server.

Notable findings:

- `--include-drafts` and `--include-future` include those posts in `/blog/`, tag pages, archives, and direct URLs. The default home page does not list posts; it lists `/blog/` and content files.
- The asciinema shortcode emits references to `/assets/asciinema-player.css`, `/assets/asciinema-player.min.js`, and `/assets/asciinema-init.js`, but those files are not generated if the configured static directory does not contain them.
- Plain markdown without front matter builds successfully and emits a warning with inferred metadata.
- Invalid explicit front matter dates fail the build as documented.

## Environment

- Repository: `/usr/home/code/ssg`
- OS: `FreeBSD code 15.0-RELEASE FreeBSD 15.0-RELEASE releng/15.0-n280995-7aedc8de6446 GENERIC amd64`
- Go: `go version go1.25.7 freebsd/amd64`
- `./mkblog --version`: `dev`
- Primary command tested: `go run ./cmd/mkblog`
- Fixture root: `/tmp/mkblog-blackbox/site`
- Output roots:
  - `/tmp/mkblog-blackbox/out-default`
  - `/tmp/mkblog-blackbox/out-included`
  - `/tmp/mkblog-blackbox/out-teletype-clean`
  - `/tmp/mkblog-blackbox/out-serve`

## Fixture

The fixture used a minimal site config with `theme: default`, copied repository themes to `/tmp/mkblog-blackbox/themes`, and created these inputs:

- `content/front-post.md`: valid YAML front matter, `slug: front-post`, tags `alpha` and `beta`
- `content/plain-note.md`: markdown without front matter
- `content/draft-post.md`: `draft: true`
- `content/future-post.md`: `date: 2099-01-01`
- `content/hidden-post.md`: `hidden: true`
- `content/terminal-demo.md`: asciinema shortcode and source shortcode
- `content/files/resume.txt`
- `content/casts/demo.cast`
- `content/snippets/demo.go`
- `static/assets/custom.txt`

## Commands Run

```sh
./mkblog --version
go version
uname -a

go run ./cmd/mkblog

go run ./cmd/mkblog build \
  --config /tmp/mkblog-blackbox/site/config.yaml \
  --content /tmp/mkblog-blackbox/site/content \
  --static /tmp/mkblog-blackbox/site/static \
  --themes /tmp/mkblog-blackbox/themes \
  --out /tmp/mkblog-blackbox/out-default

go run ./cmd/mkblog build \
  --config /tmp/mkblog-blackbox/site/config.yaml \
  --content /tmp/mkblog-blackbox/site/content \
  --static /tmp/mkblog-blackbox/site/static \
  --themes /tmp/mkblog-blackbox/themes \
  --out /tmp/mkblog-blackbox/out-included \
  --include-drafts \
  --include-future

go run ./cmd/mkblog build \
  --config /tmp/mkblog-blackbox/site/config.yaml \
  --content /tmp/mkblog-blackbox/site/content \
  --static /tmp/mkblog-blackbox/site/static \
  --themes /tmp/mkblog-blackbox/themes \
  --theme teletype-clean \
  --out /tmp/mkblog-blackbox/out-teletype-clean

go run ./cmd/mkblog serve \
  --config /tmp/mkblog-blackbox/site/config.yaml \
  --content /tmp/mkblog-blackbox/site/content \
  --static /tmp/mkblog-blackbox/site/static \
  --themes /tmp/mkblog-blackbox/themes \
  --out /tmp/mkblog-blackbox/out-serve \
  --port 18133

fetch -qo - http://localhost:18133/
fetch -qo - http://localhost:18133/front-post/
fetch -qo - http://localhost:18133/files/resume.txt
fetch -qo - http://localhost:18133/missing-page-does-not-exist
```

## Results

| Scenario | Result | Evidence |
| --- | --- | --- |
| `./mkblog --version` | Pass | Printed `dev`. |
| No command usage | Pass | Printed usage text and exited via `exit status 2` under `go run`. |
| Default build | Pass | Logged `build complete: 4 posts, 3 tags`. |
| Plain markdown without front matter | Pass | Built `/plain-note/` and warned that metadata was inferred. |
| Front matter post | Pass | Built `/front-post/`; rendered `Body for <strong>front</strong> matter post`. |
| Draft excluded by default | Pass | `/draft-post/index.html` was absent from default output. |
| Future post excluded by default | Pass | `/future-post/index.html` was absent from default output. |
| Draft/future included with flags | Pass | Built `/draft-post/` and `/future-post/`; both appeared on `/blog/` and tag pages. |
| Hidden post behavior | Pass | Built `/hidden-post/`; omitted from home, blog, and tag listings. |
| Tags | Pass | Built `/tags/alpha/`, `/tags/beta/`, and `/tags/demo/`. |
| Archives | Pass | Built `/archives/2026/`, `/archives/2026/02/`, and `/archives/2026/05/` for default output. |
| `content/files` assets | Pass | Built `/files/resume.txt` with expected content. |
| `content/casts` assets | Pass | Built `/casts/demo.cast`. |
| Static assets | Pass | Built `/assets/custom.txt`. |
| Source shortcode | Pass | Rendered the selected snippet line and the `demo snippet` title in `/terminal-demo/`. |
| Asciinema shortcode markup | Pass | Rendered player CSS/script references and player div in `/terminal-demo/`. |
| Asciinema player asset availability | Observation | `/assets/asciinema-player.css` was absent because the configured static dir did not contain the player assets. The shortcode still referenced that URL. |
| Alternate theme build | Pass | `--theme teletype-clean` built successfully and emitted `/assets/theme/style.css`. |
| Serve home page | Pass | `fetch http://localhost:18133/` returned generated HTML for `Black Box Blog`. |
| Serve post page | Pass | `fetch http://localhost:18133/front-post/` returned rendered post HTML. |
| Serve asset | Pass | `fetch http://localhost:18133/files/resume.txt` returned `resume asset`. |
| Serve missing page | Pass | `fetch http://localhost:18133/missing-page-does-not-exist` failed with `Not Found`. |
| Invalid explicit date | Pass | Build failed with `invalid date "not-a-date": supported formats: RFC3339 or YYYY-MM-DD`. |

## Generated Output Checked

Default output included:

```text
404.html
archives/2026/02/index.html
archives/2026/05/index.html
archives/2026/index.html
archives/index.html
assets/custom.txt
assets/theme/style.css
blog/index.html
casts/demo.cast
files/resume.txt
front-post/index.html
hidden-post/index.html
index.html
plain-note/index.html
tags/alpha/index.html
tags/beta/index.html
tags/demo/index.html
tags/index.html
terminal-demo/index.html
```

Included draft/future output additionally included:

```text
archives/2099/index.html
draft-post/index.html
future-post/index.html
tags/drafts/index.html
tags/future/index.html
```

## README-Facing Observations

1. `README.md` says generated home views list `content/files/*`; that matched the test. It also says hidden posts do not appear on the home page, blog index, tag pages, or archive pages. That matched the test.
2. The default theme's home page did not list posts; it showed a directory-style entry for `/blog/` and `resume.txt`. If "home views" is intended to mean post listings, README wording could be clarified.
3. The asciinema shortcode emits the documented local asset URLs, but the build does not provide missing player assets automatically. A minimal static directory therefore produces HTML that references absent player assets. This is consistent with the README note that assets come from `static/assets/`, but it is an easy setup footgun.

## Residual Risk

- I did not browser-render the generated pages; this was an HTTP and file-content black box test.
- I did not test `serve --watch`.
- I did not test every theme listed in the README, only `default` and `teletype-clean`.
- I did not test legacy `static/files` or `static/casts` fallback behavior.
