Skip to content

Skills: correctness fixes, lossless compression, and routing agents to the right reference - #41

Draft
kaessert wants to merge 3 commits into
upbound:mainfrom
kaessert:polish/r4-squashed
Draft

kaessert wants to merge 3 commits into
upbound:mainfrom
kaessert:polish/r4-squashed

Conversation

@kaessert

@kaessert kaessert commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Description of your changes

Three commits, one per kind of change, so each can be reviewed (and reverted) on its own. Everything here came out of agent runs that build, maintain and extend a Crossplane v2 configuration package from a written spec with these skills (Go, Python, go-templating; several models), followed by review passes that checked every claim against upstream source (up v0.55.0, Crossplane v2.3.1, crossplane-runtime, cel-go, apiextensions-apiserver).

1. fix: correct wrong facts, broken commands and contradictions

  • Facts agents were missing: XR status and custom conditions between reconciles (never null to drop a key); choosing the function language by the amount of logic; one test program per composition, split by file; checking credentials without printing them.
  • A composed resource the function stops returning is deleted on every existing XR, not orphaned (composition_functions.go garbage collection). The skills said "orphans" in five places. They now describe it as a migration and say how to keep the external resource.
  • XRD CEL transition rules: an optional field needs the rule on its parent; has() takes a field, never has(self)/has(oldSelf); rules don't run on absent values or on create; self == oldSelf on spec freezes the whole spec. Plus escapes, cost, and proving each rule on an API server: no build, schema check or render compiles CEL, and Crossplane accepts an XRD whose CRD then fails.
  • About 90 smaller corrections, each with a source citation in the original review:
    • connection details do reach a render when the test supplies the Secret;
    • up project build doesn't check functionRef;
    • go-templating models live in .up/json/;
    • up composition generate adds a step per function dependency;
    • teardown after setup failures;
    • nonexistent commands and flags, dead pointers, zsh-unsafe snippets.
  • Script fixes:
    • hub-health aborted when a feature-gated resource was off (bats test added);
    • hub-setup printed the minted registration token (now a umask 077 file);
    • the e2e skill now refuses to run a test whose control plane name already exists, which could reuse or delete it.

2. docs: remove duplicated and redundant text (lossless)

  • What was cut: each removed fact keeps one home that the same reader loads on the same path, with a pointer left where it was needed.
  • What didn't change: no heading, anchor, section number, binding rule or frontmatter description.
  • Size: 70,492 → 67,716 words (−3.9 %).

3. feat: route agents to the reference they need, and lint XRD CEL rules

  • The problem, measured in the runs: agents open a reference when a skill tells them to open it now, and skip it when the skill only mentions it. The reviewing row ("open review.md now") was followed in 99 % of sessions, while xrd-design.md and v2-resources.md were opened in 0–4 % of builder sessions, although they hold the facts behind the costliest failures.
  • The changes:
    • every charter routing row, and the task skills' XRD, status and first-test steps, name the file and section to open now;
    • the costliest rules get a short form in the files agents do read, linking to the detail;
    • check_xrd_schema.py flags has(self)/has(oldSelf) as an error, and warns on self == oldSelf on spec, transition rules on optional fields and oldSelf in non-map lists (tests included);
    • every reference over 100 lines starts with a contents list, and make check fails when one is missing or stale (tests included).

Net against main: skill text 69,547 → 68,927 words. 75 files, +1,254/−778 lines.

I have:

  • Run make check (10 checks), make test (222 tests OK) and make lint.
  • Used the skill with an agent and pasted the transcript below. Validation runs on this exact tree are in progress, see below.
  • Signed off every commit with git commit -s, with no model co-author trailers.
  • Run make readme if this adds or removes a skill. N/A, no skill added or removed.

How has this been tested

  • Gate: green on every intermediate state (about 170 reviewed commits before the squash). The squashed tree is identical to that history apart from main's version and CI bumps.
  • Tests: each new or changed script check has tests shown failing before the change and passing after.
  • Agent runs: builds with the commit-1 content (round of fixes before the sweeps) are running with several models. Runs on this exact tree are queued. I'll add the results here, and take the PR out of draft, once they're in.

…he skills

Corrections verified against upstream source (up v0.55.0, Crossplane v2.3.1,
crossplane-runtime, cel-go, apiextensions-apiserver), plus the facts agents
were missing when building, maintaining and extending compositions:

- XR status and custom conditions between reconciles; never write null to
  drop a key; choosing the function language by the amount of logic; one
  test program per composition, split by file; credentials are checked for
  presence without printing them.
- A composed resource the function stops returning (renamed key or removed
  resource) is deleted on every existing XR, not orphaned; how to keep the
  external resource.
- XRD CEL transition rules for optional fields (rule on the parent, has()
  takes a field, no rules on absent values or on create, self == oldSelf on
  spec freezes it), CEL escapes and cost, and proving each rule on an API
  server, since no build, schema check or render compiles CEL.
- About 90 smaller corrections: connection details in a render, the
  functionRef checkpoint, go-templating models in .up/json/, what
  up composition generate emits, teardown after setup failures, nonexistent
  commands and flags, dead pointers, zsh-unsafe snippets, a minted
  registration token printed to the terminal, an e2e run reusing a control
  plane with the same name, and hub-health aborting when a feature gate is
  off (with a bats test).

Signed-off-by: Tobias Kässer <tobias.kasser@upbound.io>
Lossless compression: each removed fact keeps one home that the same reader
loads on the same path, with a pointer left where it was needed. No heading,
anchor, section number, binding rule or frontmatter description changed.
Skill text: 70,492 -> 67,716 words (-3.9 %), most of it in the charter.

Signed-off-by: Tobias Kässer <tobias.kasser@upbound.io>
Agents open what a skill tells them to open now and skip what it only
mentions (measured: the XRD and v2-resource references were opened in 0-4 %
of sessions). So:

- every charter routing row and the task skills' XRD, status and first-test
  steps say which file and section to open now;
- the costliest rules (CEL immutability, XR status, a dropped resource is
  deleted) have a short form in the files agents read, linking to the detail;
- check_xrd_schema.py reports has(self)/has(oldSelf) as an error and warns
  on self == oldSelf on spec, transition rules on optional fields and oldSelf
  in non-map lists (tests included);
- every reference over 100 lines starts with a contents list, and make check
  fails when one is missing or stale (tests included).

Signed-off-by: Tobias Kässer <tobias.kasser@upbound.io>
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