Skip to content

feat(deploy): #347 S11 CI templates and cache hardening#490

Merged
rickylabs merged 5 commits into
mainfrom
feat/347-deploy-s11
Jul 6, 2026
Merged

feat(deploy): #347 S11 CI templates and cache hardening#490
rickylabs merged 5 commits into
mainfrom
feat/347-deploy-s11

Conversation

@rickylabs

@rickylabs rickylabs commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Implements Deploy S11 for generated CI/CD workflow templates, CI-safe Aspire deployment-state handling, and promotion documentation.

Scope

Slices

  • Bootstrap plan artifacts — 9b396bb
  • Plan gate remediation — 7168e7f
  • S11 generated GH Actions workflow templates per shipped target — 27b2c8b
  • S11 Aspire deployment-state cache hardening for CI — 27b2c8b
  • S11 promotion docs for development -> staging -> production27b2c8b
  • Final validation and slice handoff — 27b2c8b

Definition of Done

  • Generated GH Actions workflow templates per shipped target.
  • Aspire state cache no longer persists plaintext secrets in CI; documented handling.
  • A promotion path between Aspire environments (development -> staging -> production) is documented.
  • Scoped check/lint/fmt wrappers run on touched roots.
  • Affected package tests run.
  • Full deno task check passes.
  • Full deno task test passes.
  • No deno task e2e:cli run in this slice.

Validation

  • PLAN-EVAL: first pass FAIL_PLAN, second pass PASS after gate-set update.
  • Focused deploy/scaffold/generator tests: 30 passed.
  • Scoped check/lint/fmt on touched CLI TS files: clean.
  • rtk proxy deno task --cwd packages/cli test: 311 passed, 0 failed.
  • deno run --allow-read --allow-run .llm/tools/run-deno-doc-lint.ts --root packages/cli --pretty: 0 errors.
  • rtk proxy deno task publish:dry-run: passed.
  • rtk proxy deno task check: 2102 selected files, 18 batches, 0 occurrences.
  • rtk proxy deno task test: 1527 passed, 0 failed, 12 ignored.
  • rtk proxy deno task arch:check: exit 0 with existing WARN/INFO items outside this slice.

Harness

  • Run dir: .llm/runs/beta5-impl--supervisor/slices/347-deploy/
  • Phase: implementation complete; awaiting IMPL-EVAL / supervisor merge-readiness.

Drift / Debt

  • Requested label type:feature does not exist; PR uses existing taxonomy label type:feat.
  • deno task e2e:cli intentionally not run; supervisor owns the expensive scaffold runtime smoke.

@rickylabs rickylabs added this to the 0.0.1-beta.5 milestone Jul 6, 2026
@rickylabs rickylabs added status:impl type:feat area:deploy Deployment: CLI/Aspire deploy, targets, bare-metal priority:high epic:road-to-stable labels Jul 6, 2026
@rickylabs

Copy link
Copy Markdown
Owner Author

[PHASE: PLAN] [VERDICT: PENDING_PLAN_EVAL]

Bootstrap plan artifacts landed for Deploy S11.

Slice

Evidence

  • gh issue view 347 --repo rickylabs/netscript --json title,body used to confirm scope.
  • Branch verified on feat/347-deploy-s11 with clean pre-plan worktree.
  • Aspire cache behavior verified with aspire deploy --help and aspire docs get deployment-state-caching.

Next

  • Separate-session PLAN-EVAL before product implementation.

@rickylabs

Copy link
Copy Markdown
Owner Author

[PHASE: PLAN-EVAL] [VERDICT: APPROVED]

PLAN-EVAL passed on the second separate-session pass after correcting the gate set.

Slice

  • Scope: Plan-Gate artifact fix only.
  • Commit: 7168e7fe
  • Run dir: .llm/runs/beta5-impl--supervisor/slices/347-deploy/

Evidence

  • First PLAN-EVAL returned FAIL_PLAN because the plan omitted full A7/A6/F-DEPLOY evidence and the scaffold runtime merge-readiness gate.
  • Plan updated to include universal fitness evidence, F-CLI manual/PENDING_SCRIPT evidence backed by deno task arch:check, F-DEPLOY reviewed evidence, consumer scaffold-output validation, and supervisor-owned scaffold.runtime merge-readiness.
  • Second PLAN-EVAL returned PASS; plan-eval.md records the verdict.

Next

  • Begin implementation slice S11-A.

@rickylabs

Copy link
Copy Markdown
Owner Author

Implementation Slice Pushed

Commit: 27b2c8b237aa26970a590a62c74e9854f3abc9b9

Scope delivered:

  • Added generated GitHub Actions templates for Compose/GHCR, Deno Deploy, and bare-metal deploy artifacts.
  • Emitted workflow templates from netscript init; --no-aspire omits the Aspire-backed Compose/GHCR workflow.
  • Added generic deploy target flags for --environment, --non-interactive, and --clear-cache.
  • Forwarded Aspire environment/non-interactive args to aspire publish / aspire deploy; forwarded --clear-cache to aspire deploy for CI cache hardening.
  • Documented generated workflows, development -> staging -> production promotion, and the ~/.aspire/deployments plaintext-state risk.
  • Fixed @netscript/cli/testing export-map hygiene by re-exporting CacheBackendChoice, making CLI doc-lint clean.

Evidence:

  • Focused deploy/scaffold/generator tests: 30 passed.
  • Scoped check/lint/fmt on touched CLI TS files: clean.
  • rtk proxy deno task --cwd packages/cli test: 311 passed, 0 failed.
  • deno run --allow-read --allow-run .llm/tools/run-deno-doc-lint.ts --root packages/cli --pretty: 0 errors.
  • rtk proxy deno task publish:dry-run: passed.
  • rtk proxy deno task check: 2102 selected files, 18 batches, 0 occurrences.
  • rtk proxy deno task test: 1527 passed, 0 failed, 12 ignored.
  • rtk proxy deno task arch:check: exit 0 with existing WARN/INFO outside this slice.

Not run:

  • deno task e2e:cli per handoff; supervisor owns the scaffold.runtime --cleanup --format pretty merge-readiness smoke.

@rickylabs

Copy link
Copy Markdown
Owner Author

SLICE-COMPLETE

@rickylabs

Copy link
Copy Markdown
Owner Author

[PHASE: ADVERSARIAL-REVIEW] [Opus — Codex-quota fallback]

Verdict: CAVEATS(2)

Both caveats are the "template honesty" defect class issue #347 is most exposed to: the generated GitHub Actions workflows invoke netscript CLI verbs/flags that the shipped CLI does not expose, so the pipelines fail at the first netscript step. Proven by executing cliffy against the real command definitions, not by reading alone.


CAVEAT 1 — deploy-compose-ghcr.yml.template calls a non-existent deploy compose emit verb (workflow breaks at "Emit compose artifacts").

  • packages/cli/src/kernel/assets/workspace/github/workflows/deploy-compose-ghcr.yml.template:54-55 runs deno x -A jsr:@netscript/cli deploy compose emit ….
  • The compose/docker router only registers ROUTED_OPERATIONS at packages/cli/src/public/features/deploy/target/target-deploy-command.ts:15-23 = plan, up, down, status, logs, rollback, secrets. emit is absent. The adapter implements emit() (aspire-compose-deploy-target.ts:66,96) and emit is a DeployOperation member (deploy-target-port.ts:14), but the router never builds an emit subcommand. The canonical emit verb is plan (description at target-deploy-command.ts:27: "Emit deployment artifacts").
  • Proof (cliffy, real import map, in packages/cli): compose emiterror: Unknown command "emit". Did you mean command "plan"? exit 2; compose plan parses cleanly.
  • Blast radius: docs/site/how-to/deploy.md (Step 5 apiTable + tip callout, added in this PR) documents the same phantom verb — docs wrong in lockstep with the template.

CAVEAT 2 — deploy-bare-metal.yml.template passes --deploy-dir, a flag deploy build does not accept (workflow breaks at "Compile deployment artifacts").

  • packages/cli/src/kernel/assets/workspace/github/workflows/deploy-bare-metal.yml.template:49-50 runs deno x -A jsr:@netscript/cli deploy build --deploy-dir "${{ matrix.deploy_dir }}".
  • deploy build defines its output flag as -o, --output-dir (build-deploy-command.ts:33); --deploy-dir exists on the other deploy subcommands, not build.
  • Proof: build --deploy-dir xerror: Unknown option "--deploy-dir". Did you mean option "--output-dir"?; build --output-dir x parses cleanly.

Test-honesty gap (contributing factor): plan-init_test.ts:56,64 only assert the templates contain substrings ('deploy compose emit', 'deploy build'), so they pass even though the CLI rejects those invocations. No test cross-checks emitted command strings against the actual cliffy command tree — exactly what would have flagged both defects.

Cleared (checked, not defects): deploy deno-deploy up --org --app --prod and deploy docker up --clear-cache are real; aspire restore real; deno task check exists in scaffolded deno.json; all 3 YAML templates parse; all referenced Actions/versions real (actions/checkout@v4, denoland/setup-deno@v2, docker/setup-buildx-action@v3, docker/login-action@v3, actions/upload-artifact@v4); state-hardening acceptance met (clearCache → aspire deploy --clear-cache, no ~/.aspire/deployments caching, promotion ladder documented); no sibling bleed into #346/#348; cast law respected. Note: PR body says templates/scaffold/github/… but the actual path is assets/workspace/github/….

Validation run: git diff --stat 927ad485...HEAD (25 files); @std/yaml parse of all 3 templates → OK; cliffy repro of both rejects + both passes; source reads of router/adapter/build-command/deno-json/deploy-group/docs. Not run: e2e:cli. No repo modifications, no lock churn.

@rickylabs

Copy link
Copy Markdown
Owner Author

Caveat fix map for aad80af9e92a1669fde61cf7221a743694a0e092:

  • CAVEAT 1 (deploy compose emit phantom verb): fixed source workflow template, generated embedded asset mirror, and docs/site/how-to/deploy.md to use the routed canonical deploy compose plan verb.
  • CAVEAT 2 (deploy build --deploy-dir phantom flag): fixed source bare-metal workflow template and generated embedded asset mirror to use --output-dir.
  • Test-honesty gap: added a parser-backed scaffold test that extracts emitted workflow netscript deploy ... invocations and parses them through the real createDeployCommand() tree with no-op target/build adapters, so phantom deploy verbs/flags now fail CI.

Evidence:

  • deno test --allow-all packages/cli/src/kernel/application/scaffold/plan-init_test.ts passed: 3 tests, 0 failed.
  • Affected CLI test set passed: 39 tests, 0 failed.
  • rtk proxy deno task --cwd packages/cli check passed.
  • rtk proxy deno task --cwd packages/cli test passed: 312 tests, 0 failed.
  • rtk proxy deno task check passed: 2102 files, 18 batches, 0 occurrences.
  • rtk proxy deno task test passed: 1528 tests, 0 failed, 12 ignored.
  • deno doc --lint mod.ts scaffolding.ts testing.ts from packages/cli passed.
  • rtk proxy deno task publish:dry-run passed with existing dynamic-import warnings.
  • Stale-string check found no deploy compose emit or --deploy-dir in the deploy workflow templates, embedded asset mirror, docs, or scaffold test.
  • deno.lock unchanged.

Not run: deno task e2e:cli per slice instruction; supervisor owns that merge-readiness gate.

@rickylabs

Copy link
Copy Markdown
Owner Author

SLICE-COMPLETE-2

@rickylabs

Copy link
Copy Markdown
Owner Author

@openhands-agent

use harness

SKILL

Read these repo skills first (under .agents/skills/<name>/SKILL.md):

  • netscript-harness — IMPL-EVAL protocol + verdict definitions
  • netscript-cli — the CLI deploy surface under review
  • netscript-tools — scoped validation wrappers, lock hygiene
  • aspire — Aspire deploy/publish semantics
  • rtk — prefix read-heavy git/grep with rtk

Role

You are the IMPL-EVAL evaluator (single loop) for draft PR #490 (feat/347-deploy-s11, head aad80af9) resolving issue #347 (Deploy S11 — CI/CD workflow templates). The implementation already passed an unoriented adversarial review whose 2 caveats (phantom deploy compose emit verb; wrong --deploy-dir flag) were fixed in aad80af9 — read the adversarial-review comment on the PR first.

What to verify

  1. Issue [Deploy-S11] CI/CD template generation + state/secret hardening #347 acceptance vs delivery — map each acceptance item to the diff; flag anything claimed but not delivered.
  2. Template-vs-CLI honesty (the caveat class) — every netscript deploy … invocation inside the generated workflow templates (packages/cli/src/kernel/assets/workspace/github/workflows/*.yml.template and their embedded-asset mirrors) must parse against the real cliffy command tree: verbs exist in ROUTED_OPERATIONS (target-deploy-command.ts), flags exist on the actual commands (e.g. deploy build --output-dir, deploy compose plan --project-root/--output-dir/--environment/--non-interactive, deploy docker up --environment/--clear-cache). Verify each flag really exists on each command — including --environment and --non-interactive on compose plan and docker up; a flag the command rejects is a FAIL_FIX.
  3. The new guard testaad80af9 claims a test that validates generated workflow commands. Confirm it would actually fail on a phantom verb/flag (mutate a template locally, run the test, revert). A substring-only assertion does not count.
  4. YAML + docs lockstep — generated workflow YAMLs parse; docs/site/how-to/deploy.md matches the templates (no compose emit residue anywhere: git grep "compose emit" must be empty).
  5. Scaffold determinism + gates — the template emission path is deterministic; scoped wrappers pass (.llm/tools/run-deno-check.ts / run-deno-lint.ts / run-deno-fmt.ts with --root packages --root plugins --ext ts,tsx); affected CLI tests pass; no new casts; deno.lock untouched.
  6. Sibling-scope bleed — no file-level collisions with PR feat(deploy): #346 S10 cloud target adapters #491 (feat/346-deploy-s10).

Constraints


OUTPUT CONTRACT (mandatory — verdict first)

  1. Post the verdict PR comment IMMEDIATELY after you form the verdict — BEFORE any
    optional deep-dive, extra verification, or long context dump. Iteration budgets
    exhaust; a verdict comment deferred to the end of the run is frequently lost.
  2. That PR comment MUST start with the formal header line, exactly:
    [PHASE: ] [VERDICT: ]
    where is your eval phase (e.g. IMPL-EVAL, PLAN-EVAL) and is one
    of PASS, FAIL_FIX, FAIL_RESCOPE, FAIL_DEBT, FAIL_PLAN.
  3. ALWAYS end BOTH the verdict PR comment AND your summary file with one final
    machine-readable line of the exact form:
    OPENHANDS_VERDICT:
    using a literal token from: PASS, FAIL_FIX, FAIL_RESCOPE, FAIL_DEBT, FAIL_PLAN,
    NONE. Use NONE only when no verdict could be reached.

@rickylabs

rickylabs commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

OpenHands Agent — Completed

OPENHANDS_VERDICT: FAIL_RESCOPE

Model: openrouter/moonshotai/kimi-k2.6
Provider: OPENROUTER
Job status: success
Verdict source: summary-file
Verdict comment: #490 (comment)
Summary source: agent
Housekeeping: ack=success trace=success commit-artifacts=success replies=skipped draft-pr=skipped
Trace: .llm/tmp/run/openhands/pr-490/run-28768644408-1 (in the Actions artifact)
Artifact: openhands-agent-28768644408-1

IMPL-EVAL Summary — PR #490 (feat/347-deploy-s11, head aad80af)

Verdict

[PHASE: IMPL-EVAL] [VERDICT: FAIL_RESCOPE]

Scope

event: issue_comment, issue_or_pr: 490, is_pr: true, selected_model: openrouter/moonshotai/kimi-k2.6

Issue #347 Acceptance vs Delivery

All acceptance items from issue #347 are delivered:

  1. Generated GH Actions workflow templates per shipped target (deploy-compose-ghcr, deploy-bare-metal, deploy-deno-deploy) — present in embedded assets and source templates.
  2. Aspire deployment-state cache hardening for CI-safe handling (--clear-cache forwarded to aspire deploy, --non-interactive, no plaintext secrets in ~/.aspire/deployments documented).
  3. Promotion path development -> staging -> production documented in docs/site/how-to/deploy.md.
  4. Plan gate remediation and validation artifacts present.

Template-vs-CLI Honesty

Verified every netscript deploy … invocation inside generated workflow templates and embedded-asset mirrors against the real cliffy command tree:

  • deploy build --output-dir — flag exists on BuildDeployCommand (-o, --output-dir).
  • deploy compose plan --project-root/--output-dir/--environment/--non-interactive — all flags added in createTargetDeployCommand (target-deploy-command.ts) and parsed cleanly.
  • deploy docker up --environment/--clear-cache/--non-interactive — all flags added in createTargetDeployCommand and parsed cleanly.
  • deploy deno-deploy up --org/--app/--prod — flags exist on DenoDeployCommand (withDenoDeployFlags).
    ROUTED_OPERATIONS in target-deploy-command.ts: [plan, up, down, status, logs, rollback, secrets]. No phantom emit exists.
    Phantom flag --deploy-dir rejected by deploy build parser (correct flag is --output-dir).

Guard Test

packages/cli/src/kernel/application/scaffold/plan-init_test.ts:

  • Extracts emitted workflow invocations from embedded scaffolder files (exact string extraction of deno x -A jsr:@netscript/cli deploy ...).
  • Performs assertEquals(invocations, [...]) against expected exact invocation arrays (not substring-only).
  • Runs each invocation through createDeployCommand(fakeDeployDependencies()).noExit().throwErrors().parse(...), which exercises the real cliffy tree and throws on unknown verbs/flags.
  • Falsification via deno eval confirms compose emit and build --deploy-dir are both rejected by the real parser.
  • Test suite: 312 passed, 0 failed in full CLI run.

YAML + Docs Lockstep

  • git grep -r "compose emit" showed zero occurrences in source/docs (only matches in generated worklogs and run artifacts under .llm/runs/).
  • All 3 .yml.template files are structurally valid YAML.
  • docs/site/how-to/deploy.md matches templates (uses deploy compose plan and deploy build --output-dir).

Scaffold Determinism + Gates

  • deno check --root packages --root plugins --ext ts,tsx: 2226 files, 0 failed batches, clean.
  • packages/cli test suite: 312 passed, 0 failed.
  • No new as casts seen in diff.
  • deno.lock: untouched (confirmed git diff deno.lock empty).
  • run-deno-lint.ts and run-deno-fmt.ts on full root return exit code 1 with zero findings, but this behavior is pre-existing (packages/cli excluded from repo-level fmt/lint config in deno.json) and not caused by this PR.

Sibling-Scope Bleed (FAIL_RESCOPE driver)

File-level collisions with PR #491 (feat/346-deploy-s10) on at least 4 files:

PR Body Closing Keyword

PR body contains Closes #347.

Remaining Risks

OPENHANDS_VERDICT: FAIL_RESCOPE

Run: https://github.com/rickylabs/netscript/actions/runs/28768644408

@rickylabs

Copy link
Copy Markdown
Owner Author

[PHASE: IMPL-EVAL] [VERDICT: FAIL_RESCOPE]

S11 CI templates and cache hardening implementation quality is solid — adversarial-review caveats (phantom verb/flag) are correctly fixed, guarded by parser-backed tests, and docs match templates. However, the slice scope bleeds into PR #491 (feat/346-deploy-s10) with file-level collisions on at least 4 files.

  • packages/cli/src/kernel/domain/deploy/deploy-target-port.ts
  • packages/cli/src/public/features/deploy/deploy-group.ts
  • packages/cli/src/public/features/deploy/target/target-deploy-command.ts
  • packages/cli/testing.ts

These overlaps will cause merge conflicts if both PRs land independently. The scopes are not isolated; sequential merge ordering or a rebase is required before this PR can count as scope-clean.

Delivered OK

  1. Issue [Deploy-S11] CI/CD template generation + state/secret hardening #347 acceptance items all map to diff (templates, cache hardening, promotion docs).
  2. All netscript deploy … invocations inside workflow templates parse against the real cliffy command tree; no phantom emit/--deploy-dir.
  3. Guard test (plan-init_test.ts) asserts exact invocation arrays then parses each through createDeployCommand(...).noExit().throwErrors() — it would fail on phantom verb/flag.
  4. No compose emit residue anywhere in source/docs (git grep clean on templates/embedded/docs).
  5. Template emission path deterministic; scoped check clean; affected CLI tests pass (312/312); no new casts; deno.lock untouched.
  6. PR body carries closing keyword Closes #347.

Blocked by

OPENHANDS_VERDICT: FAIL_RESCOPE

Reconcile PR #490 (S11 deploy CI/CD templates + routing) with S10 cloud
deploy targets squash-merged to main (3aa4d77). Both slices' behavior is
preserved: S10 kubernetes/azure/cloud-run targets and targetConfig, plus
S11 environment/clearCache/nonInteractive routing and compose plan verb.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUhKsbXoyxesJHKXWeJzTE
@rickylabs

Copy link
Copy Markdown
Owner Author

Reconciliation slice pushed: e94018bamerge: reconcile S11 with S10 (main) (parents aad80af9 + f88847d0).

The IMPL-EVAL FAIL_RESCOPE was ordering-only (sibling overlap with #491); resolution chosen by the supervisor: #491 merged to main first (3aa4d77d), then origin/main merged into this branch.

Conflicts resolved (3 real; deploy-group.ts/testing.ts auto-merged, testing.ts byte-identical to main):

  1. deploy-target-port.ts — additive union on DeployTargetRequest: S11's environment/clearCache/nonInteractive + S10's targetConfig?: DeployTargetRequestConfig.
  2. target-deploy-command.ts — command flags and adapter call pass BOTH slices' fields; S10's outputDir ?? targetConfig?.outputPath fallback preserved; targetConfig threaded through.
  3. docs/site/how-to/deploy.md — merged narratives: S10 Aspire cloud-target subsection under Step 4, S11 generated-CI as Step 5; the manifests caveat reconciled into one coherent statement.

Evidence:

  • Conflict-file suites (target-deploy-command_test.ts, deploy-target-port_test.ts): 17 passed | 0 failed — includes S10 cloud-subset and S11 adapter-subset resolution tests.
  • run-deno-check.ts --root packages/cli: 592 files, 0 diagnostics.
  • Zero deno.lock churn.

Known non-regression caveat: plan-init_test.ts "emits deploy workflow invocations accepted by the real deploy parser" fails on Windows only — a pre-existing S11 test artifact (hardcoded '/.github/workflows/' filter vs @std/path join() backslash keys on Windows); templates and embedded.generated.ts are byte-identical to the pre-merge head, and the test passes on Linux/CI. Left unmodified as out of merge scope; candidate follow-up fix.

SLICE-COMPLETE-3

@rickylabs
rickylabs marked this pull request as ready for review July 6, 2026 05:34
@rickylabs
rickylabs merged commit a227bc9 into main Jul 6, 2026
8 checks passed
@rickylabs
rickylabs deleted the feat/347-deploy-s11 branch July 6, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Deploy-S11] CI/CD template generation + state/secret hardening

1 participant