Files
myfileagent-pipeline/handoff/member1/demo-refresh.md
T
Codex Agent 0bffbdf4bd
myfileagent-python-ci/pipeline/head This commit looks good
Final project review (live) / review (push) Successful in 53s
Review syntax after model without typo whitelist
2026-11-28 22:26:14 +00:00

36 lines
7.9 KiB
Markdown

# Demo refresh implementation and evidence
**28 November correction:** The current demo input is `print("hello` (closing quote and parenthesis missing). The revised reviewer does not list allowed typo strings; it runs the real model for syntax-invalid one-line input, statically checks that output contains only the hello demo behavior, then executes the reviewed file. Actions performs only SHA verification before inference. The one-character preparation instructions and old test counts below describe the earlier run and must not be used as current rehearsal instructions. Current evidence and limits are in `../../HANDOFF.md` and `evidence/two-character-local/README.txt`.
This change prepares the existing Actions -> Jenkins -> PDF/tests -> versioned ZIP pipeline for the live missing-parenthesis demonstration. It does not execute that rehearsal or draft the final course report.
## What the job builds
`Jenkinsfile.final-project` now invokes `demo/build_demo_pdf.py` and `demo/demo_report.tex` instead of `documentation/ci/build_manual.py`. The existing full-manual builder remains available for separate use. The short LaTeX PDF is expected to be one page and visibly records the exact committed broken source, the raw response from the real SmolLM2 model, the accepted corrected source, and their one-character diff. It also prints the release version, full source SHA, model ID, Actions run/attempt, Jenkins build, measured tokens, elapsed time, Actions-job memory, and evidence hashes. The builder validates those values against the verified review bundle before copying `documentation/build/main.pdf` into the existing release pipeline. A saved real-review bundle from Actions run 43 produced an offline one-page preview; that preview's version 1.0.5 was a test label, not a release reservation.
The final-project Gitea Actions and Jenkins unit-test commands select `tests/test_reviewer.py` and `ci/tests`, so unrelated legacy `tests/test_pricing.py` no longer appears in this demo pipeline. Jenkins displays a separate `Compile and execute model-reviewed Python` stage. The existing `ci/final_project.py test` command compiles the verified `reviewed.py`, invokes `tests/smoke_demo.py`, then independently executes `reviewed.py` and requires a zero exit code and exact `hello\n` output before writing `out/test-result.json` and permitting packaging. The intentionally broken committed `demo/demo.py` is never executed as the successful artifact. This stage separation has not yet been observed in a live Jenkins run; the selected reviewer command passed 17 tests locally.
For the audience, the live Actions step now prints the raw SmolLM2 response, accepted source diff, measured token counts and reviewed-Python smoke result after successful execution. The prior run 43 log did not show the repair; its saved `review.json` and raw-response files do. The new log presentation is prepared locally and still needs a future live run.
## Version identity
Jenkins reserves a durable version before the metrics/PDF/test stages and passes `RELEASE_VERSION` to each. The short PDF text and build manifest carry it. `out/test-result.json` records it. The release archive name, `report-<version>.pdf`, `VERSION.txt`, README, `manifest.json` (`version` and `document_version`), `release.json`, and the separate downloadable PDF/checksum all carry the same version. The upstream Actions bundle and raw review are produced before Jenkins reserves a release number; they are bound to the exact source SHA, run ID, attempt, hashes, and model identity, so their original measured bytes remain intact. A retry of the same identity reuses the immutable ZIP bytes and reserved version.
## Grafana token behavior
`ci/publish_live_metrics.py` updates `/home/codex/ssw590-final-metrics/final-project.prom` only after Jenkins verifies a live Actions bundle. It retains the underlying last-run gauges and adds `review_input_tokens_total` and `review_output_tokens_total`, cumulative counters since activation. A ledger keyed by source SHA/run ID/attempt makes a Jenkins retry idempotent. Null token counts add nothing; fixture counts are refused. The dashboard shows the cumulative panels and removes the two flat last-run token graphs. Baseline was initialized to actual zero since activation, while the underlying prior last-run gauges remain 23/5 as historical evidence. Grafana does not receive a token increment at inference start: the increase follows Jenkins verification and a Prometheus scrape. Cumulative counters are for demonstration of a new event; the exact run's token counts remain in `review.json`.
The provisioned dashboard copy is `/home/codex/myfileagent-gitea/assignment7-monitoring/monitoring/grafana/provisioning/dashboards/json/final-project.json`. Grafana's v13 resource store was checked directly: it contains the two cumulative token charts, host CPU/memory charts, and latest-run status cards; the two flat token charts are absent. The former flat memory peak/limit graph is now separate latest-run peak, warning-status, and hard-ceiling cards. Before the next review, the target-status card correctly has no sample because prior runs did not record that field. The textfile collector was checked at `node_textfile_scrape_error 0`; Prometheus returned a live input cumulative sample of 0 before the rehearsal. Grafana's authenticated API rejected programmatic access with HTTP 401, so final visual confirmation should be done in the user's signed-in dashboard. No fabricated live token counts were published.
## Memory target and safety ceiling
The model lock and shared contract still set the complete inference-workload target at **250,000,000 bytes**. The prior actual Actions run peaked exactly at its page-rounded 249,999,360-byte hard cap and recorded 433 `memory.events.max` pressure events but no OOM kill. That is not evidence of the natural uncapped peak. The Actions job now requests a **384,000,000-byte hard ceiling** with swap disabled. Its measured `memory.peak` covers runtime preparation, reviewer, child inference process, and private model tmpfs. If the peak exceeds the 250,000,000-byte target, `resource.json`, the review bundle, the short PDF and the Actions log retain an explicit warning while a successful model run continues. If the hard ceiling produces a real OOM kill, or the model fails, no ready bundle is published. Docker cannot turn an actual hard-cap OOM into a harmless warning after the process is killed. The latest-run Grafana cards are a display of recorded values, not a fabricated live process trace.
## Rehearsal preparation
The integration branch is prepared with a valid `demo/demo.py` containing exactly `print("hello")` plus a final newline. Its preparation commit uses Gitea's built-in `[skip ci]` commit-message convention; no workflow bypass was added. Confirm no Actions review starts for this preparation push. During the audience session the user deletes only the final `)` and commits the resulting `print("hello"` plus newline. That new SHA triggers real inference, Actions tests and evidence, then Jenkins. Do not run the rehearsal on the preparation commit. The next release version is determined by Jenkins's durable state; 1.0.5 is plausible after prior 1.0.4 but must be read from the new build.
## Local verification and limits
In the pinned compiler/runtime image `sha256:579106aaffa81dc2436a72a5dbfc51d3590f1a97646321fd38c694aae6d7cba1`, the updated CI suite passed 24 tests and the reviewer/application suite passed 19 before the memory display adjustment. The affected pipeline/metrics suites then passed 15 and 4 tests. Docker reported the requested 384,000,000-byte cgroup ceiling and zero swap. The modified short PDF compiled from a saved real review bundle with `pdflatex -no-shell-escape` as a one-page offline preview. This change did not rerun the real model, reserve a new live version, execute the full Jenkins job, or prove the future rehearsal succeeds. Save the Actions/Jenkins/Grafana screenshots and new review bundle during that user-led run.