Skip to content

fix: add a root charly.yml so the candy CI gate is real - #2

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/root-manifest-gates-the-candy
Aug 30, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/root-manifest-gates-the-candy

Conversation

@atrawog

@atrawog atrawog commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes this repo's candy CI gate actually gate something.

Without a root charly.yml a plugin repo is project-less: charly scans no candies at
all
, so the stock charly box validate step in deploy.yml exits 0 on any manifest —
including one with a malformed plugin.providers entry. The step has been asserting
nothing.

A four-line discover: block is the whole fix. The candy becomes scannable, the CUE schema
gate applies, and the stock step starts working — no workflow change needed. The file
declares no entities of its own; it only tells charly where to look.

Refs opencharly/charly#459.

How tested

The mechanism and the fix were established on opencharly/plugin-punktfunk
(opencharly/plugin-punktfunk#4), with a plain layer candy to isolate it — box list candies
filters plugin candies out of its own output, so a plugin candy alone cannot show this:

# candy/plainlayer/charly.yml exists, no root charly.yml
$ charly box list candies         # (nothing — not scanned at all)
$ charly box validate             # exit 0 even with a bogus field in the candy

# with the 4-line root charly.yml
$ charly box list candies
plainlayer [testing]
$ charly box validate
... notafield: field not allowed

And on a real plugin candy, before/after, same repo and command:

# `- verb:punktfunk` changed to `- notaclass:punktfunk`
# BEFORE: exit 0
# AFTER:
charly: error: command "validate": 2 validation errors:
  plugin.providers.0: invalid value "notaclass:punktfunk"
    (out of bound =~"^(kind|deploy|verb|step|build|builder|command|loader|refs|agent-runtime|terminal):...")

Consumers are unaffected, which is the real risk of adding a root manifest — a consuming
project might resolve the candy twice (once via its pinned subpath ref, once via the new
discover:). Tested by injecting the manifest into the fetched checkout that
opencharly/distro-cachyos resolves for a pinned plugin candy, then validating that project
both ways: identical result, exit 0 either way.

This repo's own gate is the acceptance: the build check on this PR runs
charly box validate at this repo root against the pinned charly. It now scans this repo's
candy, so a green check here is the first time that step has meant anything for this repo.

Rulebook compliance

  • R0 (skills) — /charly-internals:plugin (plugin repo layout, the candy-ref contract)
    and /charly-internals:git-workflow loaded before the change.
  • R1 (RCA) — root-caused, and an earlier wrong hypothesis (that the legacy candy/ walk
    skipped the CUE gate) was disproved by the plain-layer probe above before this fix was
    written.
  • R2 (no split) — this repo is fixed here, not deferred; the org-wide gap is being closed
    across every affected plugin repo in the same sweep, tracked by Plugin repos' candy CI gate validates nothing (charly box validate at a plugin repo root scans an empty set) charly#459.
  • R3 (no duplication) — one gate per repo; the stock charly box validate step is made
    to work rather than a second, parallel validation being bolted on.
  • R4 (no workarounds) — the supported mechanism (discover:) is used; no CI staging
    hack, no suppression.
  • R4a (fix the product first) — the product-side option (make validate treat a
    candy/-bearing dir as a project) was investigated and rejected: "returns nil for a
    project-less directory" is a documented contract other resolve paths rely on, so the fix
    belongs in the repo.
  • R5 (hard cutover) — additive; no deprecated path is left behind.
  • R6 (git safety) — feature branch, no force-push, no hook bypass.
  • R7 (prove the gate) — the before/after validate outputs are above, and this PR's own
    build check is the gate running for real.
  • R9 (deployed binary) — N/A — no binary, no runtime path; the provider is untouched.
  • R10 (fresh disposable proof) — N/A — this change cannot reach a running deployment; it
    changes what charly scans in the repo, which the validate A/B fully observes.
  • RDD — the high-risk assumption (that a root manifest might break remote consumption)
    was proved before landing, with the cached-checkout A/B above.
  • ADE — N/A — no install content authored; the candy's plan: is unchanged.
  • SDD — N/A — no schema or generated code touched.
  • Concurrency mandate — N/A — a single four-line file.
  • Architecture gate / placement — correct: the repo declares its own shape; core keeps
    its project-less contract unchanged.

Change classification

  • Change class: repo configuration — adds a root manifest so the existing CI gate has
    input. No source, no workflow, no schema change.
  • Verification gate: charly box validate before/after with a deliberately malformed
    manifest, a consumer-side resolution A/B, and this PR's own build check.
  • Attribution tier: fully tested and validated — the gate this change exists to repair
    was exercised in both directions, and the consumer risk was tested, with output retained
    above.

Assisted-by: Claude Code claude-opus-5[1m] (fully tested and validated)

Without a root manifest this repo is project-less: charly scans NO candies at all, so
the stock `charly box validate` step in deploy.yml exits 0 on any manifest - including
one with a malformed plugin.providers entry. The step has been asserting nothing.

A four-line discover: block is the whole fix: the candy becomes scannable, the CUE
schema gate applies, and the stock step starts working with no workflow change. The
file declares no entities of its own.

Refs opencharly/charly#459.

Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 8b08530798922076399c4fe927a0efbd1bd4839b (branch: main)

Security screen: PASS — single additive config file; no secrets, no exfiltration, no scope mismatch, no weakened guardrails (this change strengthens the CI gate by giving charly box validate real input). No embedded directives aimed at the reviewer.

Checklist: All applicable rules PASS or NA.

  • A1/A2/A3 — Body fully accounts for the single charly.yml addition; change class (repo config) matches the verification gate (charly box validate A/B with pasted before/after output, plus a consumer-side resolution A/B for the RDD risk). Attribution tier fully tested and validated is justified: the changed path (the discover: scan) executed live in the validate A/B. Footer is in the exact required *Assisted-by: …* form.
  • R1–R10 — RCA provided (project-less repo root-caused, wrong hypothesis disproved); no split (org-wide gap named to Plugin repos' candy CI gate validates nothing (charly box validate at a plugin repo root scans an empty set) charly#459); no duplication (stock step made to work, not a parallel gate); supported discover: mechanism, no workaround; R4a product-side option investigated and rejected with a documented contract reason; additive, no deprecated path; R6/R8/R9 N/A or stated; R10 N/A with a coherent reason (config cannot reach a deployment; validate A/B fully observes it).
  • RDD/ADE/SDD — RDD high-risk assumption (root manifest breaking remote consumption) proved via consumer A/B; ADE/SDD N/A with reasons.
  • Architecture gate — placement CORRECT: repo declares its own shape; core's project-less contract untouched.

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) August 30, 2026 05:05
@github-actions
github-actions Bot merged commit 9359e09 into main Aug 30, 2026
1 of 2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Aug 30, 2026
@aitrawog
aitrawog deleted the fix/root-manifest-gates-the-candy branch September 25, 2026 19:23
aitrawog added a commit that referenced this pull request Oct 6, 2026
…the web probe

Round-1 BLOCK findings on the plugin-dsh PR:

- #1 (R4a/R10 regression): appending the /api/* call made the fragment's exit
  status the final `if`, silently discarding a failed token exchange — a bad or
  expired token yielded C=401/404, the `if` was false, and the probe exited 0 while
  layer 1 was broken. The exchange now propagates: `curl … || { echo …; rm -f "$J";
  exit 1; }` on the cleanup path.
- #2 (R1/R4a overclaim): `if [ "$C" = "403" ]` failed only on exactly 403; 000
  (no response), 401, 404, 5xx and 3xx all exited 0, so the "proves the API
  surface actually answers" prose overclaimed. The assertion is now a `case` that
  rejects 403 (the fence), 000 (no response) and 5xx; the prose at every site says
  exactly that.
- #3 (A1/R5): the false single-layer claim lived in the dsh-cli skill, NOT the
  candy entity — the candy entity described the UI as "token-authenticated"
  (accurate). Its wording is still tightened to say the token is exchanged on /
  and an /api/* call asserted, so it matches the probe.

Verified live: a good token exits 0; a bad token exits 1 (the layer-1 guard); a
missing token file exits 1.

Assisted-by: OpenCode ollama-cloud deepseek-v4.1-flash (fully tested and validated)
github-actions Bot pushed a commit that referenced this pull request Oct 6, 2026
…gle-layer auth claim (#12)

* fix(dsh): assert the /api/* surface in the web probe + retire the single-layer auth claim

The shared dshWebTokenProbe fragment authenticated with the launch token and
curled the root GET /?token=… only. `dsh web` authenticates at TWO layers: the
launch token AND the Host/Origin browser-trust fence (api-request-trust), which
every /api/* call passes BEFORE authentication — a forged/non-loopback Host
returns 403 while / still loads. A GET /-only probe cannot see that fence.

- webprobe.go: after the token exchange, make one /api/* call with the cookie and
  fail on a 403, so the probe proves the app's API surface answers, not merely that
  / responds. Document both layers and the `--trusted-host` host-side requirement
  (which this in-box probe, always dialing 127.0.0.1, cannot itself observe).
- webprobe_test.go: lock in the /api/* assertion.
- candy + dsh-cli skill: retire "authenticates every request".

Closes #11

Assisted-by: OpenCode ollama-cloud deepseek-v4.1-flash (fully tested and validated)

* fix(dsh): propagate the token-exchange failure and reject 000/5xx in the web probe

Round-1 BLOCK findings on the plugin-dsh PR:

- #1 (R4a/R10 regression): appending the /api/* call made the fragment's exit
  status the final `if`, silently discarding a failed token exchange — a bad or
  expired token yielded C=401/404, the `if` was false, and the probe exited 0 while
  layer 1 was broken. The exchange now propagates: `curl … || { echo …; rm -f "$J";
  exit 1; }` on the cleanup path.
- #2 (R1/R4a overclaim): `if [ "$C" = "403" ]` failed only on exactly 403; 000
  (no response), 401, 404, 5xx and 3xx all exited 0, so the "proves the API
  surface actually answers" prose overclaimed. The assertion is now a `case` that
  rejects 403 (the fence), 000 (no response) and 5xx; the prose at every site says
  exactly that.
- #3 (A1/R5): the false single-layer claim lived in the dsh-cli skill, NOT the
  candy entity — the candy entity described the UI as "token-authenticated"
  (accurate). Its wording is still tightened to say the token is exchanged on /
  and an /api/* call asserted, so it matches the probe.

Verified live: a good token exits 0; a bad token exits 1 (the layer-1 guard); a
missing token file exits 1.

Assisted-by: OpenCode ollama-cloud deepseek-v4.1-flash (fully tested and validated)
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