Skip to content

feat(tutorial): Track 1 (YAML/OpenAPI) example files — maritime red-thread#66

Open
eskenazit wants to merge 3 commits into
mainfrom
feat/tutorial-track-1-yaml
Open

feat(tutorial): Track 1 (YAML/OpenAPI) example files — maritime red-thread#66
eskenazit wants to merge 3 commits into
mainfrom
feat/tutorial-track-1-yaml

Conversation

@eskenazit

Copy link
Copy Markdown
Contributor

Related Issue

Closes #49


What does this PR do?

Adds the Track 1 (YAML / OpenAPI) tutorial example files under
examples/tutorial/track-1-yaml/, plus the tuto_writer agent that authored them.

These are the runnable artifacts the public Shipyard tutorial page links to. The maritime
red-thread example (a Modern Maritime Registry API scoped to /ships, /ships/{imo_number}
and /crew) grows step by step across seven OpenAPI documents:

  • step-1-openapi.ymlstep-7-openapi.yml — the seven progressive OpenAPI specs.
  • openapi-ruleset.yml — the custom Polychro ruleset used from Step 3 on.
  • openapi-schema.json — the JSON Schema referenced by Step 4.
  • .polychro.yml — the project config used by Step 4.
  • functions/operation-id-unique.js — the polyglot custom rule used in Step 6.
  • EXPECTED-OUTPUT.md — the exact CLI output for every step, verified against
    polychro 1.0.0-beta1-SNAPSHOT
    .
  • LIMITATIONS.md — two known beta1 gaps documented (not fixed) and explicitly out of scope:
    • §5 — non-string-key false positive on a quoted "200" key.
    • §6 — Step 4's config.json-schema in .polychro.yml is not consumed yet.

Every diagnostic and exit code documented here was produced by running the real beta1 CLI
nothing is hand-written.


⚠️ Merge order — this PR must merge BEFORE Shipyard PR #150

The public tutorial page in naftiko/shipyard#150
links to these files on main:

  • https://github.com/naftiko/polychro/blob/main/examples/tutorial/track-1-yaml/…
  • https://raw.githubusercontent.com/naftiko/polychro/main/examples/tutorial/track-1-yaml/…

Those links only resolve once this PR is merged. Merge this PR first, then Shipyard #150.
Merging Shipyard #150 first would publish a page with broken file links.


Tests

No automated tests in this PR — it adds example fixtures and documentation only.

The example outputs were validated manually against the real 1.0.0-beta1-SNAPSHOT CLI
(classpath run from examples/tutorial/track-1-yaml/); the produced diagnostics, exit codes and
the --format agent JSON match EXPECTED-OUTPUT.md exactly.

A follow-up under #49 will add a JUnit harness that lints each example and asserts its
diagnostics, wired into CI.


Checklist

  • CI is green (build + tests)
  • Rebased on latest main
  • Small and focused — one concern per PR
  • Commit messages follow Conventional Commits
  • Apache 2.0 license header present on any new Java file (none added — examples + agent only)

Agent Context (optional)

…WIP, /users domain, to be realigned to maritime)

Refs #49. WIP checkpoint for handoff: example files are still on the
placeholder /users domain and will be realigned onto the shared maritime
Shipyard contract (GET /ships, /ships/{imo_number}, /crew). EXPECTED-OUTPUT.md
is an unverified engine-fidelity hypothesis pending the JVM gate (stage 2).
Realign the runnable Track 1 example files (step-1..7, schema) from the old /users domain onto the Modern Maritime Registry API contract (GET /ships, /ships/{imo_number}, /crew), per the shipyard tutorial drydock. Read-only: each step's defect now rides a GET operation. Add LIMITATIONS.md documenting that all diagnostics are UNVERIFIED (stale alpha3 local CLI vs beta1 repo), the missing CI harness, and the deferred Step 5 casing rule. Refs #49.
Run the 7 Track 1 lint examples against a freshly built polychro 1.0.0-beta1 CLI and replace the UNVERIFIED hypotheses in EXPECTED-OUTPUT.md with the real per-step output. Document two known limitations found during verification: a non-string-key false positive on quoted HTTP status codes (LIMITATIONS #5) and Step 4's .polychro.yml schema config not being consumed (LIMITATIONS #6). Documented only, nothing fixed. Refs #49.
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.

Polychro : tutorial track - phase 1

1 participant