Skip to content

docs: YAML limits, contractId resolution and the seed guard (forge-cli #725) - #154

Merged
fas89 merged 1 commit into
mainfrom
docs/yaml-limits-contractid-725
Oct 19, 2026
Merged

fas89 merged 1 commit into
mainfrom
docs/yaml-limits-contractid-725

Conversation

@fas89

@fas89 fas89 commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

These are the docs for forge-cli #725, the untrusted-input guards for the YAML loader, the contractId resolver and the seed guard. Merge after #725. Every new statement is marked (unreleased, forge-cli #725).

Page Change
docs/cli/validate.md New YAML limits section. It lists the caps the YAML guard applies and the message each one prints. The 5 MiB size cap and the 50-alias cap are unchanged. New: a size cap counted in UTF-8 bytes, a depth cap of 128 levels, an alias-expansion cap (100,000 added nodes or 100-fold growth) and a 5,242,880-character text cap. It also gives an example contract_load_failed and names the ODCS/ODPS commands now behind the same guard.
docs/advanced/production-troubleshooting.md A row in "Contract load and overlay errors", the page contract_load_failed links to, for the five limit messages.
docs/cli/odps.md New How a port's contractId is resolved section, covering:
• the lookup order (directory-bundle index, probes beside the product document and in contracts/, then HTTP under --allow-remote);
• the new rule that a probed file must declare the contractId as its id;
• malformed contractIds (NUL byte, non-string, too long, unparsable URL) treated as unresolved.
A sub-section covers how a directory bundle treats a file it cannot read, with the error it prints.
docs/cli/odcs.md --report records a failed parse pass. A note that validate/import use the YAML limits and read an upper-case .YAML suffix as YAML.
docs/cli/forge.md The seed guard now catches a dropped expose. A seed goes through the same YAML limits and contractId resolution.

No page moves and no existing anchor changes. The new anchors are #yaml-limits, #how-a-port-s-contractid-is-resolved and #files-a-directory-bundle-cannot-read.

Related CLI PR

Areas Updated

  • Getting Started
  • CLI Reference
  • Provider Docs
  • Walkthroughs / Examples
  • Contributing / Community Docs
  • Other (advanced: production troubleshooting)

Checklist

  • I previewed the change locally with npm run docs:dev or built it with npm run docs:build
  • I checked links, page titles, and navigation where relevant
  • Screenshots or command output are updated if needed

Verified against the code

  • Limit values and messages: taken from fluid_build/util/safe_yaml.py on #725 (MAX_YAML_BYTES, MAX_YAML_ALIASES, MAX_YAML_DEPTH, MAX_YAML_ALIAS_EXPANSION, MAX_YAML_ALIAS_EXPANSION_CHARS).
  • The contract_load_failed example, the bundle error and the exit codes: copied from runs of the #725 branch. fluid odps import/validate, fluid odcs validate/import and fluid odps-bitol validate each exit 1 on a refused file.
  • Lookup order: follows ContractResolver.resolve and DEFAULT_SUBDIRS / DEFAULT_EXTENSIONS in providers/odps_standard/resolver.py.
  • "No shipped file nests more than 9 levels": measured over every YAML file in the forge-cli repo.
  • Build: vuepress build docs builds all 236 pages, with no link-check warnings on the edited pages. The cross-page anchors resolve in the built HTML.

…i #725)

validate.md gets a YAML limits section: the size and alias-count caps
FLUID contracts already had, the new depth and alias-expansion caps,
the messages each prints, and the ODCS/ODPS readers now behind the
same guard. production-troubleshooting.md, where contract_load_failed
links, gets a row for those messages.

odps.md documents how a port's contractId is resolved, the new rule
that a probed file must declare the contractId as its id, malformed
contractIds as unresolved, and how a directory bundle treats a file it
cannot read. odcs.md and forge.md note the limits, the --report parse
pass and the seed guard catching a dropped expose.
@fas89
fas89 merged commit 2342f9e into main Oct 19, 2026
9 checks passed

This branch was previously deployed

1 inactive deployment
github-pages — 5642bdeb Deployed Oct 19, 2026 by fas89 via deploy #201
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