Skip to content

fix: the upward config walk skips lint-only fragments (#1502) - #1503

Merged
lex00 merged 1 commit into
mainfrom
fix/1502-lint-fragment-shadow
Aug 5, 2026
Merged

lex00 merged 1 commit into
mainfrom
fix/1502-lint-fragment-shadow

Conversation

@lex00

@lex00 lex00 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Closes #1502.

findProjectConfig stops at the first chant.config.* it sees, and the src/chant.config.json lint-fragment convention (cc-aws-canonical, the gitlab-* family, the k8s-*-microservice examples) puts one directly between the build directory and the project's chant.config.ts. chant build src — the examples' own npm run build, and test/aws-cc-e2e.sh step 2 — resolved the fragment, found no ownership, and built unstamped manifests. Every owned-scoped live read then withheld the k8s half (_unobserved: "filtered"): graph --live --overlay showed the canonical CC estate's Deployment/Service/PDB as neutral with no runtime Pod nodes. lifecycle diff --live still listed the objects (ownership there is a classification, not a scope), which is why aws-cc-e2e never caught it.

The fix: loadChantConfigUpward walks past a chant.config.json whose top-level keys are all lint-shape (extends/rules/overrides/plugins/policies/$schema). Skipped, not merged — lint resolution keeps its own nearest-wins walk untouched, a JSON config declaring any project-level key still wins where it stands, and chant.config.ts is never inspected (it is code; inspecting means evaluating).

Verified on cc-aws-canonical against Floci: chant build src --lexicon k8s goes from 0 to 3 objects stamped; after applying the stamped manifest, the same overlay read goes from all-neutral to all-good with 2 runtimeOwner Pod nodes, and behold's just e2e-cc-logical stage 3 takes the owner-in-box branch instead of the honest-note branch.

Tests: 3 new in config.test.ts (walk-past, project-key-wins-in-place, fragment-only-at-boundary); core suite 4026/4026.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HDqbe9YwXqqpF7VxFp1Drx

A src/chant.config.json holding only extends/rules — the convention most
of examples/ follows — ended findProjectConfig's walk one directory below
the real chant.config.ts, so `chant build src` resolved the fragment,
found no ownership, and built unstamped manifests that every owned-scoped
live read then withheld (`_unobserved: "filtered"`). The exact silent
fallback #1117's walk exists to prevent, reintroduced by the fragment
convention itself.

loadChantConfigUpward now walks past a chant.config.json whose top-level
keys are all lint-shape (extends/rules/overrides/plugins/policies/$schema).
A JSON config declaring any project-level key still wins where it stands,
and lint resolution keeps its own nearest-wins walk untouched.

Verified on cc-aws-canonical: `chant build src --lexicon k8s` goes from 0
to 3 objects stamped, and the live overlay's k8s half from all-neutral to
all-good with runtime Pod nodes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HDqbe9YwXqqpF7VxFp1Drx
@lex00
lex00 merged commit 895d61c into main Aug 5, 2026
5 checks passed
@lex00
lex00 deleted the fix/1502-lint-fragment-shadow branch August 5, 2026 19:31
lex00 added a commit that referenced this pull request Aug 5, 2026
The canonical CC estate's k8s manifests were applied by a raw kubectl in
the e2e — the one release in the lane that bypassed the component model.
cc-workload closes that: a kubectl-apply step whose stack names the same
owner the build stamps (cc-aws-canonical), so the field manager, the
prune scope, and the labels k8s's describeStackStatus selects on are one
identity.

- lexicons/k8s components/builders.ts + components/index.ts + the
  "./components" export: the typed kubectlApply step-builder, mirroring
  @intentius/chant-lexicon-aws/components. The builder admits noRollback
  directly — kubectl-apply is needs-opt-out (server-side apply keeps no
  previous state), so COMP003 requires the reason on every step.
- examples/cc-aws-canonical: the cc-workload component (dependsOn
  cc-canonical, liveNames apiService/apiDeployment/apiPdb), a
  deploy-workload script, README.
- test/aws-cc-e2e.sh: the k8s half is now released by the component, and
  step 4 asserts `components status --live` reports BOTH deploy units —
  the cfn stack via aws's describeStackStatus, the kubectl-apply unit via
  k8s's, which also proves the ownership stamp survived the round trip.

Needs #1503 (lint-fragment config shadow) for the status clause: without
it `chant build src` builds unstamped manifests and the k8s unit's label
selector matches nothing.


Claude-Session: https://claude.ai/code/session_01HDqbe9YwXqqpF7VxFp1Drx

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@lex00 lex00 mentioned this pull request Nov 20, 2026
78 of 84 tasks
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.

A lint-only src/chant.config.json shadows the project config: chant build src silently drops ownership stamping

1 participant