feat: implement Phase 5 packages (i18n, fetch, plugin, cmd)#8
Merged
Conversation
zeroedin
commented
Apr 13, 2026
zeroedin
left a comment
Owner
Author
There was a problem hiding this comment.
Code Review: feat: implement Phase 5 packages (i18n, fetch, plugin, cmd)
The largest PR so far — 664 additions across 12 files, covering 4 packages. All 108 unit tests pass, go vet clean, integration tests at 7/16 (no regressions). The hook system and CLI wiring are well-done; the i18n and fetch packages have correctness issues that need attention.
Summary
| Package | Area | Verdict |
|---|---|---|
| i18n | BuildLanguageContexts |
✅ Weight-sorted contexts, correct |
LinkTranslations |
🚫 Bug — ignores languages param, matches exact RelPath — incompatible with content tree routing |
|
FilterByLanguage |
lang field instead of content tree path |
|
BuildTaxonomiesForLanguage |
tags/categories — spec allows user-defined taxonomies |
|
| fetch | FetchREST / FetchGraphQL |
|
pluginSources |
🚫 Bug — global mutable state, not thread-safe, leaks between tests | |
FetchRESTWithRefetch |
🚫 Bug — never saves fetched data to cache | |
CacheDir |
filepath.Join |
|
| plugin | Hook registry + execution | ✅ Clean chaining, correct timeout behavior |
RunWithTimeout |
||
| QuickJS/WASM runtimes | ✅ Reasonable simulation for walking skeleton | |
hasNodeRuntimeExport |
strings.Contains can match comments/strings |
|
| cmd | Root + serve flags | ✅ Correct flags, defaults match spec §9 |
init command |
🚫 Bug — RunE returns nil without calling RunInit |
|
build/serve RunE |
init has working code that isn't wired) |
See inline comments for details on blockers.
zeroedin
commented
Apr 13, 2026
zeroedin
commented
Apr 13, 2026
zeroedin
commented
Apr 13, 2026
zeroedin
commented
Apr 13, 2026
zeroedin
commented
Apr 13, 2026
zeroedin
commented
Apr 13, 2026
zeroedin
commented
Apr 13, 2026
Implement all four Phase 5 packages, passing 108 tests total: - internal/i18n (18 tests): language contexts, translation linking, output prefixes, taxonomy building, and translation info extraction - internal/fetch (16 tests): REST/GraphQL fetching, JSON file cache with TTL, XML/CSV parsing, and plugin source registry - internal/plugin (59 tests): plugin registry with tier classification, hook registry with timeout enforcement, LSP-style message framing for Node bridge, QuickJS/WASM runtime simulation, and sandbox checks - cmd (15 tests): global flags (config, output, verbose, quiet), serve-specific flags (port, preview, no-drafts, refetch), init command with config creation, and version command Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bugs fixed: - LinkTranslations now uses `languages` param to strip lang prefix from RelPath before grouping (e.g. "en/about.md" + "fr/about.md") - pluginSources map protected with sync.RWMutex for thread safety, added ResetPluginSources() for test isolation - FetchRESTWithRefetch saves fetched data to cache after successful fetch - init command RunE now calls RunInit, handles "already exists" gracefully Warnings fixed: - CacheDir uses filepath.Join instead of string concatenation - FetchGraphQL adds HTTP status code check (>= 400) and uses http.Client with 30s timeout instead of default client Goroutine leak in RunWithTimeout filed as issue #13 (requires breaking HookFunc signature change to accept context.Context). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zeroedin
force-pushed
the
feature/phase-5
branch
from
April 13, 2026 02:51
0b9d19d to
5450c8e
Compare
3 tasks
This was referenced May 6, 2026
This was referenced May 20, 2026
zeroedin
added a commit
that referenced
this pull request
Jul 8, 2026
P1 #1: Add ResolveLayoutForFormat filename candidate step test (my-post.json when my-post.json.liquid missing). P1 #2: Add ResolveLayoutChain error test when parent has neither .liquid nor bare extension. P2 #4: Add Go engine ResolveLayoutChain negative test — verifies gotemplate never resolves .liquid parent in chain. P2 #7: Add IMPLEMENTATION.md note about ResolveLayoutWithCascade dual short-circuit paths needing simultaneous fixes. P3 #8: Normalize "bare-ext"/"engine-ext" to full form in per-candidate interleaving test. 27 specs total: 18 red, 9 green. Refs #827 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Jul 8, 2026
zeroedin
added a commit
that referenced
this pull request
Jul 8, 2026
- P1 #1: Integration test now asserts error instead of discarding with _ = err - P1 #2: Blog index format chain now covers all 5 steps (added default fallback and error tests), extracted newIndexPage() helper - P1 #3 / P2 #5: Pseudocode updated to 5-arg signature, removed stale output.ResolveFormatLayout comment - P2 #4: Cascade tests now cover fall-through to auto candidates and layout: false + cascade interaction - P2 #6: Pseudocode shows both ResolveLayoutForFormat and ResolveLayoutForFormatWithCascade call sites - P3 #7: Extracted newIndexPage() helper for blog index tests - P3 #8: Added gotemplate + date-based section format chain test Refs #864 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Jul 8, 2026
This was referenced Jul 10, 2026
zeroedin
added a commit
that referenced
this pull request
Jul 16, 2026
- P0 #1–#2: Corrected IMPLEMENTATION.md edge case (1) to list all three loadSiteData error sources (data directory parse failures, missing external files, external key collisions). Removed false claim that data directory errors are swallowed inside loadSiteData — they are propagated as errors per issue #982. Merged former edge case (2) into (1) since both exercise the same error branch. Corrected edge case (2) to describe nil-data path (deleted data directory). - P1 #3: Fixed test comment claiming external files are the only error source — enumerated all three sources. - P1 #4: Added descriptive failure messages to collision test sanity assertions. - P2 #5: Fixed count mismatch — "four" → "five" edge cases. - P2 #6: Replaced blanket "both preserve stale data" with accurate description: error path always preserves; nil-data path preserves only when directory still exists. - P3 #8: Added JSON-serialized value assertion on collision test to verify original "Sprocket" data survives, not collision "Gear" data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Jul 24, 2026
Merged
zeroedin
added a commit
that referenced
this pull request
Jul 25, 2026
- P0 #1: Update bridge.js inbound parser to handle split-body frames (X-Body-Length/X-Body-Field headers) and outbound sendMessage to produce split-body frames for hook results with html/content fields - P0 #2-3: Add bounds and negative-value validation on Content-Length and X-Body-Length in both DecodeMessage and Send before slicing or allocating - P1 #4: Require X-Body-Field header when X-Body-Length is present; error on empty field name - P1 #5: Restore stdout pollution detection — first header line in Send must start with "Content-Length:", rejecting "debug: ..." lines - P1 #6: Switch stripField to JSON round-trip (marshal struct → unmarshal to map → delete key) per IMPLEMENTATION.md spec, so new struct fields are automatically included - P1 #7: DecodeMessage split-body injection prefers Result map, falls back to Payload map when Result is nil, per spec - P2 #8: Use len(fieldValue) directly in EncodeMessage instead of allocating []byte(fieldValue) copy for byte-length measurement Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All 108 tests pass across the four Phase 5 packages.
Test plan
go test ./internal/i18n/ -count=1— 18/18 passgo test ./internal/fetch/ -count=1— 16/16 passgo test ./internal/plugin/ -count=1— 59/59 passgo test ./cmd/ -count=1— 15/15 pass🤖 Generated with Claude Code