Skip to content

Apply readable Links Notation format to all languages and docs - #40

Merged
konard merged 12 commits into
mainfrom
issue-39-e53c893293ed
Aug 20, 2026
Merged

Apply readable Links Notation format to all languages and docs#40
konard merged 12 commits into
mainfrom
issue-39-e53c893293ed

Conversation

@konard

@konard konard commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

Closes #39. PR #38 made the readable indented Links Notation the default only in
Rust
. This PR brings JavaScript, Python and C# to the same default, locks the
four implementations to byte-identical output, and removes the structural reason
the languages were able to drift apart in the first place.

What changed

1. Readable format is the default in all four languages

  • New readable module in JS, Python and C# (Rust already had it); encode/decode
    now produce the readable indented tree by default in every language.
  • Shared, language-agnostic conformance fixtures
    (fixtures/readable-format/cases.json, 39 cases) are executed by a harness in
    every language and assert byte-identical encode and round-trip decode. This
    is what makes "applied to all languages" machine-checked.

2. CI fails when languages drift (issue #39, requirement 2)

  • New scripts/check-language-parity.mjs + .github/workflows/parity.yml run on
    every PR with no paths: filter, and fail unless 0 or all 4 languages'
    src/ changed. An intentional single-language change opts out with
    [skip-parity] in the PR title/body. The gate has its own unit tests.

3. Cross-language compact boolean interop fix

  • JS/Rust wrote (bool true), Python/C# wrote (bool True), and each decoder only
    accepted its own spelling — so a compact document written by one language decoded
    to the wrong boolean in another. All encoders now write lowercase true/false;
    all decoders compare case-insensitively. Regression tests added in every language.

4. Opt-in tracing / verbose mode (requirement 5)

  • LINO_CODEC_DEBUG (1/true/yes/on) or a code override
    (set_debug_enabled / setDebugEnabled / CodecDebug.SetEnabled /
    debug::set_debug_enabled) enables stderr tracing in all four languages. Off by
    default.

5. Docs (requirement 1)

  • All five READMEs updated: Output Formats table, (base64 "…") marker,
    readable-vs-compact "How It Works", cycle/identity rule, and a Debugging section.

6. Deep case study (requirement 4)

  • docs/case-studies/issue-39/README.md reconstructs the timeline, enumerates all
    seven requirements, gives per-requirement root cause + solution, compares the four
    pipeline templates file-tree (requirement 3), and surveys the reused components.
    Raw data (issue/PR JSON, CI logs, the parser-bug note) is under
    docs/case-studies/issue-39/data/.

7. Related-issue findings (requirement 6)

  • Compact boolean interop — found and fixed here in all four languages (above).
  • links-notation (id: …) parser bug — reproduced on 0.11.2, already fixed
    upstream in 0.14.0
    , and already worked around by the codec; documented in
    docs/case-studies/issue-39/data/links-notation-parser-bug.md. Recommended
    follow-up (bump the Python/JS pins to 0.14.0) is noted but out of scope for this
    format-focused PR.

CI hygiene from the templates (requirement 3)

  • Adopted the templates' least-privilege permissions, timeout-minutes and
    concurrency on the parity workflow. The templates' security.yml
    (CodeQL + dependency-review) and links.yml are documented as recommended
    follow-ups in the case study — not merged here because they need repository
    settings that would risk red first-run CI.

Release fragments

One coordinated minor release fragment/changeset per language (js .changeset,
csharp .changeset, python + rust changelog.d).

Verification

All local CI green: Python (ruff/mypy, 162 tests), JS (npm run check, 244 tests),
Rust (fmt/clippy, 17+3 tests, 7 doctests, script tests, example), C# (format/build
/warnaserror, 171 tests), the 39 shared fixtures in every language, and the
parity gate.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #39
@konard konard self-assigned this Aug 20, 2026
konard added 11 commits August 20, 2026 06:24
…rget versions

python/.ruff.toml replaced [tool.ruff] in pyproject.toml instead of adding to
it, so the declared rule selection was dead and ruff ran its own default set.
The stray file is gone, its isort setting moved in with the real package name,
and the tool target versions now match requires-python.
…ures

Add fixtures/readable-format/cases.json (39 hand-written cases from the
format spec) and per-language suites that check each language encodes each
value to exactly the shared text and decodes it back, so the four
implementations verify each other rather than agreeing on a shared mistake.

Also single-source the Python __version__ from installed distribution
metadata so it never drifts from pyproject.toml.
JavaScript and Rust wrote (bool true) while Python and C# wrote (bool True),
and each decoder understood only its own spelling, so a compact document
written by one language decoded to the wrong boolean in another. Every
language now writes the lowercase form and reads either spelling, so old
documents keep working. Adds a regression suite in all four languages.
PR #38 changed only the Rust codec and no other language's CI ran, because
each workflow filters itself by paths:. This adds .github/workflows/parity.yml
(no paths: filter) and scripts/check-language-parity.mjs, which fails a pull
request when one language's src/ changed without the others. An intentional
single-language change opts out with [skip-parity] in the PR title or body.
Covered by scripts/check-language-parity.test.mjs (7 cases).
…t works in the monorepo

The check matched repo-root-relative git paths (rust/src/...) against
subdirectory-relative patterns (^src/, ^scripts/, changelog.d/). In the
monorepo this silently disabled fragment enforcement for real rust/src
changes and falsely tripped on unrelated repo-root scripts/ changes.
Adding --relative reports paths relative to the CI working-directory
(rust/), so the existing patterns match correctly. Refs #39.
…udy, harden parity workflow

- Remove tracked debugging leftovers: test_debug.py, python/test_encoder_fix.py,
  issue_details.json, pr_status.json, and the orphaned .github-workflows-test.yml
  (a workflow at repo root that GitHub Actions never ran).
- Move PARSER_BUG.md into docs/case-studies/issue-39/data/ and record that the
  links-notation parser bug is fixed in 0.14.0 and already worked around here.
- Add least-privilege permissions and a job timeout to the parity workflow,
  matching the hygiene in the language pipeline templates. Refs #39.
@konard konard changed the title [WIP] Apply it to all languages and docs Apply readable Links Notation format to all languages and docs Aug 20, 2026
@konard
konard marked this pull request as ready for review August 20, 2026 07:37
@konard

konard commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Everything is complete. Issue #39 is fully addressed in PR #40, now marked ready for review with all CI green.

What was delivered against each requirement

  1. Readable format in all languages + docs — Ported the readable indented Links Notation default (encode/decode) from Rust to JavaScript, Python and C#. Locked with 39 shared fixtures (fixtures/readable-format/cases.json) that assert byte-identical encode and round-trip decode in all four languages. All five READMEs updated.

  2. CI fails on single-language drift — New scripts/check-language-parity.mjs + .github/workflows/parity.yml run on every PR with no paths: filter and fail unless 0 or all 4 languages' src/ changed ([skip-parity] escape hatch). Root cause was the per-language paths: filters that let PR feat(rust): make readable indented Links Notation the default encoding #38 stay green Rust-only.

  3. Template best practices — Full file-tree comparison in the case study; adopted least-privilege permissions, timeout-minutes and concurrency; documented security.yml (CodeQL + dependency-review) and links.yml as ready-to-use follow-ups. No spurious upstream template issue (the one CI bug found was monorepo-specific).

  4. Deep case studydocs/case-studies/issue-39/README.md with timeline, all 7 requirements, per-requirement root cause + solution, template comparison, and a reused-components survey; raw data under docs/case-studies/issue-39/data/.

  5. Debug/verbose mode — Opt-in tracing via LINO_CODEC_DEBUG (or code override) added to all four languages, off by default.

  6. Related issues fixed everywhere — Found and fixed a cross-language compact boolean interop bug ((bool True) vs (bool true)) in all four languages with regression tests; documented the upstream links-notation (id: …) parser bug (already fixed in 0.14.0, already worked around).

  7. Single PR — All work on issue-39-e53c893293ed, atomic commits, main merged.

Verification: All 6 CI runs green on the final commit 5d19373 (Python, JavaScript, Rust, C#, and two Parity runs), matching local results — Python 162, JS 244, Rust 17+3+7 doctests+scripts, C# 171, plus the 39 shared fixtures and the parity gate.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $24.729167

📊 Context and tokens usage:

Claude Opus 5: (6 sub-sessions)

  1. 114.4K / 1M (11%) input tokens, 31.3K / 128K (24%) output tokens
  2. 116.2K / 1M (12%) input tokens, 37.4K / 128K (29%) output tokens
  3. 116.8K / 1M (12%) input tokens, 35.8K / 128K (28%) output tokens
  4. 117.0K / 1M (12%) input tokens, 50.5K / 128K (39%) output tokens
  5. 109.1K / 1M (11%) input tokens, 50.6K / 128K (40%) output tokens
  6. 51.6K / 1M (5%) input tokens, 8.3K / 128K (7%) output tokens

Total: (11.5K new + 316.4K cache writes + 12.1M cache reads) input tokens, 147.9K output tokens, $12.963626 cost

Claude Opus 4.8:

  • 117.0K / 1M (12%) input tokens, 121.9K / 128K (95%) output tokens

Total: (4.5K new + 236.4K cache writes + 12.7M cache reads) input tokens, 121.9K output tokens, $11.765542 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus (claude-opus-5)
  • Thinking level: medium (~15999 tokens)
  • Main model: Claude Opus 5 (claude-opus-5)
  • Additional models:
    • Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (8840KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit 41e3f4a into main Aug 20, 2026
37 checks passed
@konard

konard commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

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.

Apply it to all languages and docs

1 participant