Run artifact

workspace/targets/toml/blueprint/ARCHITECTURE.md

ARCHITECTURE: TOML 1.0.0 Parser

FieldValue
Version20260816 V1
DescriptionStandard-library-only Go architecture for a TOML 1.0.0 command-line decoder.
Depends On—
Providescmd/toml-decoder, internal/toml, Go module
Consumes—

Intent

The project is a Go command-line filter that reads a TOML 1.0.0 document from standard input and emits deterministic tagged JSON. Parsing is implemented in internal/toml, while cmd/toml-decoder owns process I/O, JSON encoding, diagnostics, and exit status.

Modules and Boundaries

ModuleResponsibility
cmd/toml-decoderRead stdin, invoke the parser, encode successful results, and report failures.
internal/tomlParse TOML 1.0.0 syntax and semantics into tagged values and tables.
go.modDeclare the Go module and toolchain floor without third-party dependencies.

The command must not read configuration files, access the network, persist data, or modify supplied scoring assets. The parser must use only the Go standard library.

Tagged Value Model

Tables map to JSON objects and arrays map to JSON arrays. Every scalar value is represented as an object containing string-valued type and value fields. Supported type tags are string, integer, float, bool, datetime, datetime-local, date-local, and time-local.

Technology Stack

Programmatic Acceptance

=== AC architecture-build ===
Intent: The declared Go module and decoder command compile without third-party module requirements.

import subprocess

result = subprocess.run( ["sh", "sources/stage_contract.sh", "architecture"], capture_output=True, text=True, ) print(result.stdout) print(result.stderr) assert result.returncode == 0 === END AC architecture-build ===

=== AC architecture-module ===
Intent: The command package is buildable through the required repository path.

import subprocess

result = subprocess.run( ["go", "build", "./cmd/toml-decoder"], capture_output=True, text=True, ) print(result.stdout) print(result.stderr) assert result.returncode == 0 === END AC architecture-module ===

=== AC architecture-dependencies ===
Intent: The module declares no forbidden third-party dependency.

from pathlib import Path

module_text = Path("go.mod").read_text(encoding="utf-8") require_lines = [ line for line in module_text.splitlines() if line.lstrip().startswith("require ") ] assert not require_lines === END AC architecture-dependencies ===

User Acceptance

Guardrails