Skip to content

polish: align JSON digest with machine-orientation principle#3

Merged
Wintersta7e merged 5 commits into
mainfrom
polish-machine-orientation
May 8, 2026
Merged

polish: align JSON digest with machine-orientation principle#3
Wintersta7e merged 5 commits into
mainfrom
polish-machine-orientation

Conversation

@Wintersta7e
Copy link
Copy Markdown
Owner

Summary

Five focused commits aligning every Vectis output surface with the machine-orientation principle (agents primary; humans only via vectis explain).

  • Remove markdown digest emitter — agent-secondary surface, ~190 lines + 4 tests gone
  • Drop generated_at from JSON — same input + same binary now produce byte-identical output
  • Architecture signals as structured tokensarchitecture.signals: ["workspace:cargo", "dir:controllers", "runtime:Java", ...] replaces the prose reasoning string in JSON; reasoning stays on the struct for vectis explain (humans)
  • Slim emits external edges — slim's dependency_graph.edges[] now matches stats.total_edges; agents see the third-party landscape without falling back to --format json
  • Pluralise the -v summary1 file not 1 files

Schema breaks (intentional, v0.1.0)

  • JSON architecture.reasoning removed → architecture.signals array added
  • JSON generated_at removed (was a timestamp; now bit-identical reproducibility)
  • Slim dependency_graph.edges now includes external edges (target=null, target_external=<raw>)
  • --format md removed; vectis-digest.md no longer produced

Verification

  • 285/285 tests pass (was 288 — 4 markdown tests removed, 1 slim-externals test added)
  • clang-tidy clean across the diff (CI scope)
  • clang-format clean
  • Smoke-tested on tests/fixtures/code/sample-multimodule: architecture.signals now reads ["layout:monolith", "partial-layering", "dir:service", "dir:dao"]; slim emits external edges with target=null shape

Vectis digests are consumed by agents; the markdown surface was the
only fully human-oriented format and duplicates information already
covered by slim/full JSON and `vectis explain`. Drops ~190 lines of
build_markdown plus its four tests, removes --format md from the CLI
parser, and leaves the JSON paths unchanged. Also takes a copy-by-ref
in Export_WritesFileAtDefaultLocation that clang-tidy flagged once
the surrounding markdown tests went away.

Co-Authored-By: Rooty
Vectis digests are agent-consumed: same input + same binary should
yield byte-identical output so cache invalidation, diffing, and
content-hash comparisons stay sound. The generated_at timestamp
killed that property silently. The vectis_version field carries the
schema-pinning value; runtime time has no use to a downstream agent.
Drops the helper, the chrono/ctime includes, and updates the test to
guard against regression.

Co-Authored-By: Rooty
Adds a `signals` field to ArchitectureDescription carrying a flat
list of `category:value` tokens (`workspace:cargo`,
`dir:controllers`, `runtime:Java`, `manifest:pyproject.toml`, ...).
JSON exporter emits the array; agents can grep / pattern-match it
directly without parsing the prose `reasoning` string. `reasoning`
is now human-only and stops being emitted in JSON.

Workspace and library helper return shapes grew a sibling `signals`
member so each detection branch publishes its own evidence rather
than reconstructing it at the call site. Three small helpers
(`dir_signal`, `push_matching_dir_signals`, `push_manifest_signals`)
collapse the repeated `dir:<name>` loops and the
`runtime:/manifest:` pairs each branch needs.

Co-Authored-By: Rooty
Slim previously filtered unresolved (external) dependency edges out
of the edges array but left them counted in stats.external_edges, so
edges[].size() < stats.total_edges in slim — an inconsistent schema
for an agent that compares the two. Slim now emits external edges
with target=null and target_external=<raw import string>, matching
the full format. Cycles remain full-only.

Net effect on a real ~84k-edge digest: slim grows ~10% but its dep
graph is now self-consistent and gives agents the third-party
landscape they need without parsing the full format.

Co-Authored-By: Rooty
A single-file run printed `1 files, 1 symbols, 1 deps`. Replaces the
duplicated fprintf in run_explain and compute_digest_body with one
formatter (count_word + scan_summary_line) so both CLI entry points
emit the same line and 1-of-anything reads grammatically.

Co-Authored-By: Rooty
@Wintersta7e Wintersta7e enabled auto-merge (rebase) May 8, 2026 17:40
@Wintersta7e Wintersta7e merged commit 743da2e into main May 8, 2026
5 checks passed
@Wintersta7e Wintersta7e deleted the polish-machine-orientation branch May 8, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant