Skip to content

feat(dev): add --inflight-staging flag to run.py - #1372

Merged
kalbasit merged 2 commits into
mainfrom
feat-dev-add-inflight-staging
Jun 8, 2026
Merged

kalbasit merged 2 commits into
mainfrom
feat-dev-add-inflight-staging

Conversation

@kalbasit

@kalbasit kalbasit commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • The in-flight NAR staging feature (serve --cache-inflight-staging-enabled, added in 541a25c) had no way to be enabled from the dev harness dev-scripts/run.py, so it could not be exercised or reproduced locally.
  • Adds an --inflight-staging toggle that appends --cache-inflight-staging-enabled to every spawned serve instance. Only the enabled toggle is exposed; retention (5m) and part-size (8 MiB) keep their Go defaults.
  • No locker guard rails are added, mirroring the Go-side guard where the feature self-disables on non-distributed lockers (it only engages with --locker redis).
  • Effective state is surfaced in the startup banner and persisted to state.json (inflight_staging) so test drivers can read it.
  • Captures the dev-run-inflight-staging capability spec (OpenSpec change archived).

Test plan

  • task fmt / task lint pass
  • run.py --inflight-staging emits --cache-inflight-staging-enabled and records inflight_staging: true; without the flag no --cache-inflight-staging-* arg appears and state shows false

The in-flight NAR staging feature (serve --cache-inflight-staging-enabled,
added in 541a25c) had no way to be enabled from the dev harness, so it
could not be exercised or reproduced locally.

Add an --inflight-staging toggle to dev-scripts/run.py that appends
--cache-inflight-staging-enabled to every spawned serve instance. Only the
enabled toggle is exposed; retention (5m) and part-size (8 MiB) keep their
Go defaults. No locker guard rails are added, mirroring the Go-side guard
where the feature self-disables on non-distributed lockers. The effective
state is surfaced in the startup banner and persisted to state.json so
test drivers can read it.

Also captures the dev-run-inflight-staging capability spec.
@kalbasit

kalbasit commented Jun 8, 2026 •

Copy link
Copy Markdown
Owner Author

This change is part of the following stack:

Change managed by git-spice.

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request go Pull requests that update go code labels Jun 8, 2026
@coderabbitai

coderabbitai Bot commented Jun 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 699031c7-b44f-41ae-b7d2-92dc37ae37a6

📥 Commits

Reviewing files that changed from the base of the PR and between 8b7b131 and 4080e57.

📒 Files selected for processing (1)
  • dev-scripts/run.py

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a new --inflight-staging CLI flag to the development harness. When enabled, the harness propagates the staging toggle to spawned instances, surfaces the effective enabled/disabled state in the startup banner, and persists the effective boolean in the local state file.
  • Documentation

    • Added spec, design, proposal, and task docs detailing behaviors, banner/state reporting, and verification steps.

Walkthrough

Adds a new --inflight-staging CLI flag to the dev harness; the script computes an effective staging_active (enabled only when --inflight-staging and --locker redis), prints a banner line showing disabled/enabled/dormant, appends --cache-inflight-staging-enabled to spawned instances when active, and persists inflight_staging in var/ncps/state.json. OpenSpec docs/specs/tasks were added.

Changes

In-Flight Staging Flag Implementation

Layer / File(s) Summary
Feature specification and design
openspec/specs/dev-run-inflight-staging/spec.md, openspec/changes/archive/2026-06-08-add-inflight-staging-flags-to-dev-run/*
Specification, design, proposal, and task documents that define the --inflight-staging flag, its propagation to spawned serve processes, banner/state reporting as inflight_staging, and stated non-goals (no retention/part-size knobs, no harness locker enforcement).
Dev harness flag implementation
dev-scripts/run.py
Adds --inflight-staging argparse option; computes staging_active = args.inflight_staging and args.locker == "redis"; prints inflight-staging banner (disabled/enabled/dormant); when active appends --cache-inflight-staging-enabled to the Go app args; writes inflight_staging: staging_active into generated state.json.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • kalbasit/ncps#1355: Main PR wires the new --inflight-staging dev flag to pass --cache-inflight-staging-enabled into the Go app, directly enabling the Go cache read-path behavior changed in #1355.
  • kalbasit/ncps#1356: The harness flag propagation and state.json wiring in this PR control whether the reclaim/GC logic related to in-flight staging runs.
  • kalbasit/ncps#1353: Implements holder-side staging producer/consumer behavior gated on the flag and distributed locker; functionally related to this harness wiring.

Suggested labels

documentation, size:S, merge-stack

Poem

🐰 I hopped into the dev-run tree,
A tiny flag for staging, quiet as can be.
Banner lights and state file sing,
Spawned instances hear the staging ring.
Hooray — the harness passes it along!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately and concisely summarizes the main change: adding an --inflight-staging flag to the dev-scripts/run.py file.
Description check ✅ Passed The pull request description is directly related to the changeset, explaining the motivation for adding the flag, how it works, and verification steps performed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

@kalbasit
kalbasit enabled auto-merge (squash) June 8, 2026 08:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the --inflight-staging flag in the dev-scripts/run.py development harness, propagating --cache-inflight-staging-enabled to spawned instances, logging its status in the startup banner, and persisting it in state.json. The reviewer suggests refining both the startup banner and the persisted state to reflect the effective staging state (dormant vs. active) based on whether a distributed locker like redis is configured.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread dev-scripts/run.py Resolved
Comment thread dev-scripts/run.py Resolved
The startup banner and state.json reported in-flight staging as
enabled/true whenever --inflight-staging was passed, even with
--locker local. The Go-side InflightStagingEnabled() guard keeps the
feature dormant without a distributed locker, so this misrepresented
the effective state that test drivers read from state.json.

Compute staging_active = flag AND locker == redis. The banner now
shows a third 'dormant (requires redis locker)' state, and state.json
persists the effective boolean. The --cache-inflight-staging-enabled
arg is still emitted on the raw flag, preserving the no-guard-rails
behavior that defers activation to the Go guard.

Addresses gemini-code-assist review on #1372.
@kalbasit
kalbasit merged commit 15b0c63 into main Jun 8, 2026
37 checks passed
@kalbasit
kalbasit deleted the feat-dev-add-inflight-staging branch June 8, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant