Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: changed-scope-quality-weekly
name: changed-scope-quality-nightly

on:
schedule:
- cron: '45 3 * * 1'
- cron: '45 3 * * *'
workflow_dispatch:
inputs:
feedback_jsonl_path:
Expand All @@ -18,7 +18,7 @@ on:
- 'configs/changed_scope/rule_tuning.json'
- 'tests/fixtures/changed_scope/changed-scope-feedback.schema.json'
- 'tests/fixtures/changed_scope/changed-scope-feedback.sample.jsonl'
- '.github/workflows/changed-scope-quality-weekly.yml'
- '.github/workflows/changed-scope-quality-nightly.yml'

permissions:
contents: read
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
summary_md=".runtime-cache/test_output/changed_scope_quality/${latest_week}/changed_scope_quality.summary.md"
if [[ -f "${summary_md}" ]]; then
{
echo "## changed-scope-quality-weekly"
echo "## changed-scope-quality-nightly"
echo "- run_id: ${RUN_ID}"
echo "- input: \`${INPUT_PATH}\`"
echo "- sample_fallback_used: \`${SAMPLE_FALLBACK_USED}\`"
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: changed-scope-quality-weekly-${{ github.run_id }}
name: changed-scope-quality-nightly-${{ github.run_id }}
retention-days: 14
if-no-files-found: warn
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
schedule:
# Daily run (Tuesday-Sunday): 03:00 UTC
- cron: "0 3 * * 0,2-6"
# Weekly run: Monday 03:00 UTC
# Nightly full run: Monday 03:00 UTC
- cron: "0 3 * * 1"

permissions:
Expand Down
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Work in CortexPilot as a contract-first engineering agent:

## Generated Governance Context

- active CI layers: `pre-commit`, `pre-push`, `hosted`, `nightly`, `manual`
- do not reintroduce a sixth CI/profile/workflow layer; move scheduled heavy checks to `nightly` and explicit high-cost verification to `manual`

<!-- GENERATED:ci-topology-summary:start -->
- trust flow: `ci-trust-boundary -> quick-feedback -> hosted policy/core slices -> pr-release-critical-gates -> pr-ci-gate`
- hosted policy/core slices: `policy-and-security, core-tests`
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,20 @@ npm run test
`npm run security:scan:closeout` only when you intentionally want the stricter
closeout/manual layers.

Current CI contract has five layers only:

| Layer | What it owns | Default posture |
| --- | --- | --- |
| `pre-commit` | cheap local commit-time quality gates | automatic, local, fast |
| `pre-push` | local fast verification before remote CI | automatic, local, still bounded |
| `hosted` | GitHub-hosted base CI and required checks | automatic, remote, hosted-first |
| `nightly` | scheduled heavier audits and analytics | automatic, scheduled, non-default |
| `manual` | owner-invoked closeout or high-cost validation | explicit, protected, high-friction |

There is no separate sixth CI layer anymore. Old extra-layer behavior now
belongs either to `nightly` scheduled governance or to explicit `manual`
verification.

`npm run test:quick` now expects the dashboard clean-room install gate to
prove `jsdom` itself can load, instead of pinning success to the presence of a
specific transitive dependency layout such as `data-urls`.
Expand Down
3 changes: 1 addition & 2 deletions configs/ci_policy.core.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
"execution": {
"test_phase_parallel": true,
"apply_retention": false,
"nightly_full": false,
"weekly_full": false
"nightly_full": false
},
"defaults": {
"external_web_probe_url": "https://example.com",
Expand Down
4 changes: 2 additions & 2 deletions configs/ci_policy.profiles.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"layer": "profile",
"schema": "schemas/ci_policy.schema.json",
"description": "Profile-level CI defaults (pr/nightly/weekly).",
"description": "Profile-level CI defaults (pr/nightly/manual).",
"source_of_truth": [
"scripts/ci.sh"
]
Expand Down Expand Up @@ -45,7 +45,7 @@
"p1_max_threshold_percent": 1.0
}
},
"weekly": {
"manual": {
"ui_flake": {
"p0_iterations": 50,
"p1_iterations": 50,
Expand Down
14 changes: 1 addition & 13 deletions configs/env.registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -2929,18 +2929,6 @@
"scripts/ci.sh"
]
},
{
"name": "CORTEXPILOT_CI_WEEKLY_FULL",
"scope": "ci",
"secret": false,
"required": false,
"default": null,
"owner": "platform",
"description": "CORTEXPILOT_CI_WEEKLY_FULL controls ci runtime behavior and is consumed by 1 first-party path(s).",
"consumers": [
"scripts/ci.sh"
]
},
{
"name": "CORTEXPILOT_CLEANUP_CONFIRM",
"scope": "platform",
Expand Down Expand Up @@ -4664,7 +4652,7 @@
"required": false,
"default": "auto",
"owner": "platform",
"description": "Selects E2E timeout budget profile (auto|pr|nightly-full); auto resolves using nightly/weekly CI flags.",
"description": "Selects E2E timeout budget profile (auto|pr|nightly-full); auto resolves using nightly CI flags.",
"consumers": [
"scripts/e2e_dashboard_high_risk_actions_real.sh"
]
Expand Down
22 changes: 11 additions & 11 deletions configs/governance/continuous_ops.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"min_scoped": 4,
"fail_on_todo": 0
},
"p2_weekly_target": {
"p2_nightly_ramp": {
"enabled": true,
"tiers": "P2",
"surfaces": "dashboard,desktop",
Expand All @@ -30,62 +30,62 @@
"partial_count": 63,
"covered_count": 0
},
"min_weekly_gap_reduction": 1.0,
"min_gap_reduction": 1.0,
"fail_closed_mode": "strict",
"ramp_table": [
{
"week_offset": 1,
"target_partial_max": 63,
"target_covered_min": 0,
"min_weekly_gap_reduction": 0.0
"min_gap_reduction": 0.0
},
{
"week_offset": 2,
"target_partial_max": 60,
"target_covered_min": 3,
"min_weekly_gap_reduction": 1.0
"min_gap_reduction": 1.0
},
{
"week_offset": 3,
"target_partial_max": 56,
"target_covered_min": 7,
"min_weekly_gap_reduction": 1.0
"min_gap_reduction": 1.0
},
{
"week_offset": 4,
"target_partial_max": 50,
"target_covered_min": 13,
"min_weekly_gap_reduction": 1.5
"min_gap_reduction": 1.5
},
{
"week_offset": 6,
"target_partial_max": 42,
"target_covered_min": 21,
"min_weekly_gap_reduction": 1.5
"min_gap_reduction": 1.5
},
{
"week_offset": 8,
"target_partial_max": 34,
"target_covered_min": 29,
"min_weekly_gap_reduction": 2.0
"min_gap_reduction": 2.0
},
{
"week_offset": 10,
"target_partial_max": 24,
"target_covered_min": 39,
"min_weekly_gap_reduction": 2.0
"min_gap_reduction": 2.0
},
{
"week_offset": 12,
"target_partial_max": 12,
"target_covered_min": 51,
"min_weekly_gap_reduction": 2.5
"min_gap_reduction": 2.5
},
{
"week_offset": 14,
"target_partial_max": 0,
"target_covered_min": 63,
"min_weekly_gap_reduction": 2.5
"min_gap_reduction": 2.5
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ navigation set.

## Public CI Contract

- active CI layers are `pre-commit`, `pre-push`, `hosted`, `nightly`, and `manual`
- no sixth CI/profile/workflow layer exists in this repository
- default public CI is hosted-first and GitHub-hosted
- fork PRs stay on low-privilege checks only and must not touch secrets or
live/external systems
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"ui:truth:gate": "bash scripts/ui_e2e_truth_gate.sh",
"ui:ops:pr": "UI_REGRESSION_PROFILE=pr UI_REGRESSION_REQUIRE_FULL_STRICT=1 UI_REGRESSION_REQUIRE_CRITICAL_P2=1 UI_REGRESSION_CLICK_INVENTORY_REQUIRED=1 bash scripts/ui_regression_operational_gate.sh --profile pr",
"ui:ops:nightly": "UI_REGRESSION_PROFILE=nightly bash scripts/ui_regression_operational_gate.sh --profile nightly",
"ui:ops:weekly": "UI_REGRESSION_PROFILE=weekly bash scripts/ui_regression_operational_gate.sh --profile weekly",
"ui:ops:manual": "UI_REGRESSION_PROFILE=manual bash scripts/ui_regression_operational_gate.sh --profile manual",
"bench:e2e:speed": "bash scripts/bench_e2e_speed.sh",
"bench:e2e:speed:dry-run": "bash scripts/bench_e2e_speed.sh --rounds 3 --ui-full-gemini-strict --dashboard-high-risk --dry-run",
"bench:e2e:speed:report-only": "bash scripts/bench_e2e_speed.sh --report-only",
Expand Down
6 changes: 3 additions & 3 deletions schemas/ci_policy.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@
"enum": [
"pr",
"nightly",
"weekly"
"manual"
]
},
"profiles": {
"type": "object",
"required": [
"pr",
"nightly",
"weekly"
"manual"
],
"properties": {
"pr": {
Expand All @@ -212,7 +212,7 @@
"nightly": {
"$ref": "#/$defs/profile_unit"
},
"weekly": {
"manual": {
"$ref": "#/$defs/profile_unit"
}
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_governance_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def fmt_pct(value: Any) -> str:
f"- Generated At: `{payload['generated_at']}`",
f"- Run ID: `{payload['run_id']}`",
"",
"## Weekly 5 Metrics",
"## Governance 5 Metrics",
"",
"| Metric | Value | Notes |",
"|---|---:|---|",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MatrixScope:
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description=(
"Compute weekly P2 PARTIAL/COVERED statistics and weekly target convergence "
"Compute nightly P2 PARTIAL/COVERED statistics and nightly ramp convergence "
"with configurable fail-closed mode."
)
)
Expand All @@ -29,8 +29,8 @@ def parse_args() -> argparse.Namespace:
parser.add_argument("--surfaces", default="dashboard,desktop", help="Comma-separated surfaces")
parser.add_argument("--partial-status", default="PARTIAL", help="Status label counted as PARTIAL")
parser.add_argument("--covered-status", default="COVERED", help="Status label counted as COVERED")
parser.add_argument("--target-partial-max", type=int, required=True, help="Weekly target upper bound for PARTIAL count")
parser.add_argument("--target-covered-min", type=int, required=True, help="Weekly target lower bound for COVERED count")
parser.add_argument("--target-partial-max", type=int, required=True, help="Nightly ramp upper bound for PARTIAL count")
parser.add_argument("--target-covered-min", type=int, required=True, help="Nightly ramp lower bound for COVERED count")
parser.add_argument(
"--baseline-week-start",
required=True,
Expand All @@ -39,10 +39,10 @@ def parse_args() -> argparse.Namespace:
parser.add_argument("--baseline-partial", type=int, required=True, help="Baseline PARTIAL count")
parser.add_argument("--baseline-covered", type=int, required=True, help="Baseline COVERED count")
parser.add_argument(
"--min-weekly-gap-reduction",
"--min-gap-reduction",
type=float,
default=0.0,
help="Minimum average weekly reduction of target gap.",
help="Minimum average reduction of target gap since the baseline window.",
)
parser.add_argument(
"--as-of-date",
Expand All @@ -61,7 +61,7 @@ def parse_args() -> argparse.Namespace:
default=1,
help="Fail when scoped rows are fewer than this value (default: 1). Use 0 to disable.",
)
parser.add_argument("--gate-name", default="ui-matrix-p2-weekly-target", help="Gate name in output")
parser.add_argument("--gate-name", default="ui-matrix-p2-nightly-ramp", help="Gate name in output")
parser.add_argument("--report-out", default="", help="Optional output JSON report path")
return parser.parse_args()

Expand Down Expand Up @@ -161,11 +161,11 @@ def main() -> int:

days_elapsed = (as_of_date - baseline_date).days
weeks_elapsed = max(1, (days_elapsed + 6) // 7)
avg_weekly_gap_reduction = (baseline_gap - current_gap) / float(weeks_elapsed)
avg_gap_reduction = (baseline_gap - current_gap) / float(weeks_elapsed)

partial_target_pass = partial_count <= args.target_partial_max
covered_target_pass = covered_count >= args.target_covered_min
convergence_target_pass = avg_weekly_gap_reduction >= args.min_weekly_gap_reduction
convergence_target_pass = avg_gap_reduction >= args.min_gap_reduction
targets_pass = partial_target_pass and covered_target_pass and convergence_target_pass

iso_year, iso_week, _ = as_of_date.isocalendar()
Expand All @@ -174,8 +174,8 @@ def main() -> int:
f"scoped={len(scoped_rows)} partial={partial_count} covered={covered_count} todo={todo_count} "
f"target_partial_max={args.target_partial_max} target_covered_min={args.target_covered_min} "
f"gap={current_gap} baseline_gap={baseline_gap} weeks_elapsed={weeks_elapsed} "
f"avg_weekly_gap_reduction={avg_weekly_gap_reduction:.3f} "
f"target_min_weekly_gap_reduction={args.min_weekly_gap_reduction:.3f} "
f"avg_gap_reduction={avg_gap_reduction:.3f} "
f"target_min_gap_reduction={args.min_gap_reduction:.3f} "
f"targets_pass={str(targets_pass).lower()} fail_closed_mode={args.fail_closed_mode}"
)
print(summary)
Expand All @@ -187,7 +187,7 @@ def main() -> int:
}

report = {
"report_type": "ui_matrix_p2_weekly_target",
"report_type": "ui_matrix_p2_nightly_ramp",
"schema_version": 1,
"generated_at": datetime.now(timezone.utc).isoformat(),
"gate_name": args.gate_name,
Expand All @@ -208,10 +208,10 @@ def main() -> int:
"partial_count": partial_count,
"covered_count": covered_count,
"todo_count": todo_count,
"weekly_target": {
"nightly_ramp": {
"partial_max": args.target_partial_max,
"covered_min": args.target_covered_min,
"min_weekly_gap_reduction": args.min_weekly_gap_reduction,
"min_gap_reduction": args.min_gap_reduction,
},
"baseline": {
"week_start_date": baseline_date.isoformat(),
Expand All @@ -222,7 +222,7 @@ def main() -> int:
"convergence": {
"weeks_elapsed": weeks_elapsed,
"current_gap": current_gap,
"avg_weekly_gap_reduction": avg_weekly_gap_reduction,
"avg_gap_reduction": avg_gap_reduction,
},
"checks": {
"partial_target_pass": partial_target_pass,
Expand All @@ -243,11 +243,11 @@ def main() -> int:
if not targets_pass:
if args.fail_closed_mode == "warn":
print(
f"[{args.gate_name}] warning: weekly targets not met "
f"[{args.gate_name}] warning: nightly ramp targets not met "
"(mode=warn, exit=0; use mode=strict to fail-closed)"
)
if args.fail_closed_mode == "strict":
print(f"[{args.gate_name}] fail-closed: weekly targets not met")
print(f"[{args.gate_name}] fail-closed: nightly ramp targets not met")
return 1

return 0
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ run_lane_continuous_governance() {
if [[ "${mode}" == "quick" ]]; then
governance_args+=(--quick)
else
governance_args+=(--check-weekly-target)
governance_args+=(--check-nightly-ramp)
fi

run_in_container_argv bash scripts/run_continuous_governance_ops.sh "${governance_args[@]}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e_dashboard_high_risk_actions_real.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ is_truthy_flag() {
TIMEOUT_PROFILE_INPUT="${CORTEXPILOT_E2E_TIMEOUT_PROFILE:-auto}"
TIMEOUT_PROFILE_SOURCE="auto"
if [[ "$TIMEOUT_PROFILE_INPUT" == "auto" ]]; then
if is_truthy_flag "${CORTEXPILOT_CI_NIGHTLY_FULL:-0}" || is_truthy_flag "${CORTEXPILOT_CI_WEEKLY_FULL:-0}"; then
if is_truthy_flag "${CORTEXPILOT_CI_NIGHTLY_FULL:-0}"; then
TIMEOUT_PROFILE="nightly-full"
else
TIMEOUT_PROFILE="pr"
Expand Down
Loading
Loading