Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
86b3b2b
docs: establish Workstream B implementation and validation contracts
techieworld2 Oct 18, 2026
ae184cd
feat: add RouterOS runbook and fail-safe notification adapters
techieworld2 Oct 18, 2026
2e04901
chore: normalize text across Windows and Linux tooling
techieworld2 Oct 18, 2026
c8b84c0
feat: add operator dashboard with fixture and live API transports
techieworld2 Oct 18, 2026
e0a6e25
ci: validate workspace and boot a pinned isolated RouterOS CHR
techieworld2 Oct 18, 2026
2b38f68
feat: add seeded telemetry scenarios and traceable RIPE calibration
techieworld2 Oct 18, 2026
bb6e8d7
feat: add bounded detector adapters and separated evaluation runner
techieworld2 Oct 18, 2026
8bce8dc
docs: publish implementation guide and measured validation boundaries
techieworld2 Oct 18, 2026
4fecaff
fix: pin free hosting tier and preserve reproducible calibration inputs
techieworld2 Oct 18, 2026
f8b500f
fix: handle real CHR console input and control browser test clocks
techieworld2 Oct 18, 2026
4ba49f3
docs: record successful CI and real CHR smoke evidence
techieworld2 Oct 18, 2026
9cb082d
feat: bind partner modules to merged core and remove speech generation
techieworld2 Oct 18, 2026
875c7f0
feat: prepare real TabPFN detection and verify simulator Gate 2
techieworld2 Oct 18, 2026
a778e72
wip
techieworld2 Oct 18, 2026
bcf555c
chore: relock after merging main
techieworld2 Oct 18, 2026
ce3325f
Merge remote-tracking branch 'origin/main' into b/workstream-b
techieworld2 Oct 18, 2026
1c13c85
feat: integrate merged API and detector runtime
techieworld2 Oct 18, 2026
5a4ee05
Merge remote-tracking branch 'origin/main' into b/workstream-b
techieworld2 Oct 18, 2026
a9b13ac
test: verify API approve flow on phone viewport
techieworld2 Oct 18, 2026
519879b
fix(detector): use merged core settings and schemas
techieworld2 Oct 18, 2026
48e2483
feat(eval): call agent and optional CHR fix checks
techieworld2 Oct 18, 2026
302afc7
docs: restore partner plan scope and runtime flow
techieworld2 Oct 18, 2026
8082b4d
feat(render): host the replay API in demo mode
techieworld2 Oct 18, 2026
fa986e7
Merge remote-tracking branch 'origin/main' into b/workstream-b
techieworld2 Oct 18, 2026
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
18 changes: 18 additions & 0 deletions .codex/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Start a new sandboxed Codex session with this project profile to enforce reads.
# An already-running unrestricted session cannot acquire this boundary retroactively.
default_permissions = "netcortex"

[permissions.netcortex.filesystem]
glob_scan_max_depth = 8
":minimal" = "read"

[permissions.netcortex.filesystem.":workspace_roots"]
"." = "write"
".env" = "deny"
"**/.env" = "deny"
"**/.env.*" = "deny"
"**/*credentials*.env" = "deny"
"secrets" = "deny"

[permissions.netcortex.network]
enabled = true
10 changes: 10 additions & 0 deletions .github/admin-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# GitHub repository owner setup

This repository contains CI workflows and Copilot review instructions. A workflow cannot enable Copilot automatic reviews by itself.

1. Confirm the repository is eligible for Copilot code review under the account's current plan and policies.
2. A repository administrator can configure repository-level automatic review under **Settings → Copilot → Code review**, if organization/enterprise policy allows it. Organization owners may instead configure a ruleset that automatically requests Copilot review for targeted repositories.
3. Decide whether new pushes and draft pull requests should be reviewed automatically. Check billing/credit implications and current plan terms before enabling them.
4. Open a test pull request and verify that Copilot appears as a reviewer and posts a review. Until an owner confirms this, describe Copilot review as a setup task, not an enabled feature.

See GitHub's current [Copilot code review configuration guide](https://docs.github.com/en/copilot/how-tos/copilot-on-github/set-up-copilot/configure-code-review) and [review usage guide](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-code-review).
10 changes: 10 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# NetCortex pull request review guidance

- Check that code stays within the owner's folders and does not clone or redefine Aun's schemas, Settings, API, SSE events, Temporal workflows, or router harness.
- For every network call, verify a finite timeout, bounded response handling, and explicit failure behavior. A fallback must not imply successful model inference, provider lookup, or router validation.
- Verify telemetry units, timestamps, source labels, subscriber privacy, forecast keys, and injection behavior against approved shared contracts. Flag guessed fields as unresolved rather than treating them as correct.
- For model and provider changes, check that offline tests cover failures and do not call real services.
- For router changes, distinguish fake/offline unit coverage from CHR integration. Only `infra/chr/test_templates.py` running on the isolated router counts as real template validation.
- Inspect template parameter validation and rollback behavior. Do not treat a successful REST status alone as proof a change was applied or improved service.
- Check that secrets, router passwords, subscriber identifiers, raw RIPE downloads, generated Parquet, and logs containing credentials are not committed or exposed to browser bundles.
- Look for concrete test evidence and accurate status claims. Do not approve documentation that claims a first user, measured results, paid/free eligibility, or a live deployment without evidence.
47 changes: 47 additions & 0 deletions .github/decision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# CI and router integration decisions

## CI scope

GitHub Actions runs Python lint and offline tests on the locked workspace, plus the web app's required lint, typecheck, production build, and Playwright suite once `apps/web/package.json` exists. The web job may show a clearly labeled pending state before the app exists. Once it exists, missing lockfile, required scripts, Playwright config, or `@playwright/test` fails the job.

The root Python environment is installed with `uv sync --all-packages --locked`. This keeps workspace packages importable in tests and ensures CI does not silently resolve different dependencies from the reviewed lock.

## CHR selection and provenance

The router workflow pins the official x86 CHR artifact to RouterOS 7.24.5, rather than resolving the moving `stable` channel during each run. The official `NEWESTa7.stable` endpoint returned `7.24.5 1790691687` on 2026-10-18. The downloaded official `chr-7.24.5.img.zip` was 45,293,979 bytes and its SHA-256 is `16f07222a3213352c9c4fbea4f4dec6a8ffb78fdc0fa5e398c23103ed357c6eb`.

The helper uses QEMU directly because CI needs an isolated RouterOS instance with the real REST API and a writable disk for testing apply/read-back/rollback. It chooses KVM only when `/dev/kvm` is writable and otherwise uses TCG. The router is exposed through host forwarding bound to `127.0.0.1` for REST and SSH; the serial console stays on a Unix socket. This keeps the test router off public and shared network interfaces.

Provisioning handles the first-login license flow by answering `n` to the optional software-license display prompt, sending Enter at its continuation prompt, and answering `y` only when RouterOS asks to agree to the license terms. Each prompt is handled once within the bounded serial provisioning deadline. The first serial read uses the remaining deadline rather than a shorter per-read cap because TCG startup may take longer than 20 seconds before the login prompt appears. It creates a random per-run admin password through the serial console and enables `www` with `rest-plain=yes`. MikroTik's [IP services reference](https://help.mikrotik.com/docs/spaces/ROS/pages/103841820/Services) documents `rest-plain` as the REST API support property for HTTP `www`. The helper fails on CLI error text rather than treating a returned prompt as proof the command worked. It emits the GitHub Actions secret mask before sending the generated password, writes the credential to later steps through `GITHUB_ENV`, and stores redacted serial transcript diagnostics after successful provisioning and on failures so later REST readiness errors retain console context. Serial input lines end with a single carriage return: the failed real boot transcript showed the password prompt repeated twice followed by New passwords do not match after CRLF submissions. The helper now detects password rejection immediately and preserves prompt text already buffered after a match. The readiness gate makes two consecutive authenticated calls to `/rest/system/resource` and requires the expected single resource object with a `board-name` field. A bare HTTP 200 is insufficient evidence that RouterOS REST is ready.

## External router test gate

The bootstrap, router lifecycle, QEMU command, credential handling, license/password prompts, CLI error handling, and response-shape checks are B-owned and tested offline with fake console/process/network responses. `infra/chr/test_templates.py` is Aun-owned. When it is absent, a separate smoke job boots CHR and verifies authenticated REST readiness, while the real template job remains skipped with a pending summary. Unit tests and boot smoke do not count as template apply/read-back/rollback tests.

The workflow retains `/tmp/netcortex-chr/qemu.log` as an artifact and cleanup validates both the recorded PID and its QEMU command line before signaling it. The disk and log remain in the runner temp directory until the job is discarded; no downloaded router image is committed.

## Copilot review

Repository instructions can shape Copilot's review, but automatic review still requires repository/organization admin configuration and a qualifying Copilot plan. See [admin-setup.md](admin-setup.md). The repository does not claim Copilot review is enabled until an owner verifies the setting in GitHub.

## Verified implementation run

The corrected [CHR smoke](https://github.com/aunraza19/NetCortex/actions/runs/39131915789) passed on `d60ffac`, including authenticated REST readiness and cleanup. The template job was skipped because Aun's harness is absent. [Python/frontend CI](https://github.com/aunraza19/NetCortex/actions/runs/39131915864) also passed.

## Template job baseline

When Aun's real harness is present, CI boots `infra/chr/chr.py start`, which
applies the canonical three-NIC baseline in `infra/chr/baseline.rsc`. The
one-NIC `.github/scripts/chr_bootstrap.py` helper remains only for the separate
missing-harness smoke job. This preserves the static primary route, backup
uplink, LAN queues, and DNS baseline required by failover, queue, and resolver
template checks.

The template job creates a fresh URL-safe password for that job, emits its
GitHub Actions mask before writing only `CHR_REST_URL`, `CHR_USERNAME`, and
`CHR_PASSWORD` to `GITHUB_ENV`, and then runs the real harness with its JSON
report path. Its always-run stop step uses the canonical `chr.py stop` command.
The uploaded artifacts are restricted to `var/chr/qemu.log` and
`var/chr/template-results.json`; router disks and environment files are never
uploaded. `.github/scripts/chr_ci_env.py` has offline tests and no credential
or file access outside the explicit GitHub environment file.
21 changes: 21 additions & 0 deletions .github/flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# CI entry and exit flow

## Normal pull request

**Entry:** a push to `main` or a `b/**` branch, any pull request, or manual `workflow_dispatch` starts `.github/workflows/ci.yml`.

1. The Python job installs Python 3.12 and the complete locked uv workspace. It runs Ruff and pytest, including B's offline CHR bootstrap tests.
2. The web job checks whether `apps/web/package.json` exists. Before the app lands, it writes a pending note and exits without claiming web coverage. After the app exists, it requires the lockfile, lint/typecheck/build/e2e scripts, Playwright config, and Playwright dependency; then it runs `npm ci`, those four checks, and Chromium Playwright tests.
3. Jobs exit green only when their applicable checks pass. A missing integrated web app is reported as pending in the job summary.

## CHR template pull request

**Entry:** changes to RouterOS templates/fixes, Aun's harness, this bootstrap helper, its workflow, or a manual dispatch start `.github/workflows/chr-templates.yml`.

1. Readiness checks only for Aun's `infra/chr/test_templates.py`.
2. If missing, the template job is skipped and the summary says no CHR/template tests ran. A separate smoke job installs QEMU/the locked workspace, tests B's offline lifecycle code, and boots/provisions the pinned router.
3. If present, only the real template job runs; it installs QEMU/the locked workspace, writes a fresh masked job password to `GITHUB_ENV`, and starts the canonical `infra/chr/chr.py` router. The smoke job stays skipped to avoid a duplicate boot.
4. `chr.py start` boots the three-NIC `infra/chr/baseline.rsc` topology. The template job runs Aun's unmodified harness against that primary/backup/LAN and DNS baseline, writing `var/chr/template-results.json`.
5. On every outcome, the template job attempts `uv run --locked python infra/chr/chr.py stop` and retains only `var/chr/qemu.log` and the harness JSON report when present. The one-NIC bootstrap helper remains only in the missing-harness smoke job.

**Exit:** actual template coverage is reported only when Aun's harness ran. Bootstrap unit tests, boot smoke, job setup, and a missing-harness skip do not count as an actual router/template test pass.
Loading
Loading