Skip to content

Bounds on types, step 10: pins, migration, build --reconcile - #130

Merged
Kinflou merged 4 commits into
mainfrom
feat/bounds-step-10
Nov 3, 2026
Merged

Kinflou merged 4 commits into
mainfrom
feat/bounds-step-10

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Step 10 of the bounds rollout (ComlineProject/core#98, ComlineProject/core#197). Closes #128.

Pins, moved together so cargo builds one copy of each crate (Cargo.lock has one comline-core and one comline-codegen):

  • comline-core 8f5dc91 (core master: bounds, and the CAS reconcile from core#198);
  • generation c303722 (comline-codegen, comline-doc-markdown, comline-doc-html), the rev both generators pin;
  • comline-rust 2d50fbf, comline-typescript ea9b9e2;
  • runtime 17c3b70 (comline-runtime-conformance, and comline-reference in tests/fixtures/conformance) for conformance spec 0.3;
  • tests/fixtures/generators moved the same way.

Migration. The design (docs design/type-bounds.md, Tooling): "comline lists every unbounded position and offers to add a package default, from the author's input, never guessed."

  • The build already lists each position (bounds::unbounded, one per position, each with its fix).
  • When a build or check fails on them, the error now ends with how many there are, the settings = { bounds = { string = { max = N } array = { max = N } } } block for config.idp (only the kinds that are unbounded), and a link to the types guide.
  • On a terminal (not --plain), comline build offers to add the block, asking for each maximum. It never picks one. Empty skips; if config.idp already has settings, it says to add the keys there instead. After writing, it builds again.
  • Fixtures: simple_project, chat_project, conformance_package and validated_project get package defaults (256 characters, 1024 items). validated_project's friends: Handle[] becomes friends: Handles with type Handles = Handle[] (the alias-suffix rule). Tests that write their own config.idp add the same defaults (with_bounds in tests/cli/util.rs).
  • Scaffold: comline new's sample has message: char[max 280], and config.idp has a commented settings block with the bound defaults.

comline build --reconcile <hash> (#128): calls core's cas::reconcile::mark_diverged with the dropped head, then builds. It's refused for a hash that isn't a commit and conflicts with --watch. Whenever a build starts from two heads (a Git conflict or --reconcile), the output now says so: reconciled the diverged history: continued from <onto>, recorded <other> as the second parent. When nothing needed building, it names the head it continued from. This needs no core change: the CLI reads the heads before building and the new head's parents after.

validate_on_decode (decided): the default is collect. Not running validators on decode is a give-up written with its reason, validate_on_decode = { off = "why" }. A bare "off" is refused with that fix (comline-codegen, ComlineProject/generation#116). --validate-on-decode takes collect or first. The give-up is shown:

  • comline generate notes it for each target: target rust: decoding does not run @validators checks (validate_on_decode given up: "why");
  • comline inspect lists it after the protocols as target rust (comline.toml) / validators on decode given up / because "why", and --json has validate_on_decode_given_up.

The comline new comment line shows the new values.

Round 2 pins: generation c303722 (ComlineProject/generation#116), comline-rust 2d50fbf (ComlineProject/comline-rust#104, which counts a bounded string in characters), comline-typescript ea9b9e2 (ComlineProject/comline-typescript#127). Core and the runtime are unchanged.

Also: the comline doc open help text mentions the "HTML already rendered" case, and docs/cli.md documents build --reconcile and drops the nonexistent --release.

Merge after ComlineProject/generation#116, ComlineProject/comline-rust#104 and ComlineProject/comline-typescript#127. Merge before ComlineProject/language-server, ComlineProject/playground, the comline-typescript CI change, and docs (the std drift check passes once this merges).

…int and offer; build --reconcile (core#98 step 10)
@Kinflou

Kinflou commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Generated code, CLI main vs this branch (Rust target, comline build && comline generate on each fixture: main's fixture with main's CLI, this branch's fixture with this branch's CLI):

  • No strings or lists (a scratch package of structs of u32, an enum and a protocol): byte-identical.
  • simple_project, chat_project, validated_project (now with package defaults of 256 characters and 1024 items): every string and list gets the runtime's bound adapters (comline_runtime::bounds::decode/encode::string::<_, 256>, __comline_bounds::items_max_1024_of_chars_max_256). The file header names the comline-runtime dependency (17c3b70), and IR_HASH / CONNECTION_IR_HASH change because the shape hash covers bounds (core#200). A bounded string argument is owned (text: String, ChatSendParams without a lifetime) where it borrowed &str before. The end-to-end driver is updated for that.
  • A package using std (use std::http::Request): std's http.rs bounds uri at 8192 characters. The connection hash changes with it.
  • One regression, in comline-rust: a validator on a bounded string counted bytes (value.len()) instead of characters (value.chars().count()). This hits validated_project's StringBounds(min_chars = 2, max_chars = 8), and the tests still pass only because they use ASCII. It's fixed in validators: count a bounded string's length in characters comline-rust#104. Once that merges, comline-rust's pin needs to move here, in the language server and in the playground.

@Kinflou
Kinflou merged commit 4931c60 into main Nov 3, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/bounds-step-10 branch November 3, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

build: report a reconciled history, and a flag to reconcile a ref already resolved to one side

1 participant