jenkins improvements

This commit is contained in:
2026-04-21 17:37:07 +01:00
parent 401a56a4c6
commit 15e1e2321e
8 changed files with 209 additions and 93 deletions
@@ -26,7 +26,7 @@ The runtime edge is no longer broadly untested. The repository now already conta
The remaining problem is governance, not raw test absence.
Global coverage metrics already exist through `cargo llvm-cov`, and CI already enforces a workspace-wide minimum gate. That is useful, but insufficient on its own. A good aggregated number does not guarantee that firmware transitions, boot flow, host-dependent surfaces, or domain-specific status-first contracts are covered at the right level.
Global coverage metrics already exist through `cargo llvm-cov`. A single aggregated workspace gate proved useful, but insufficient on its own. A good aggregated number does not guarantee that firmware transitions, boot flow, host-dependent surfaces, or domain-specific status-first contracts are covered at the right level.
The project therefore needs an explicit domain-based acceptance model for tests:
@@ -37,9 +37,9 @@ The project therefore needs an explicit domain-based acceptance model for tests:
## Decisao
PROMETEU SHALL govern runtime-edge test sufficiency through a two-layer model:
PROMETEU SHALL govern runtime-edge test sufficiency through a domain-first model:
1. a mandatory global coverage gate enforced in CI; and
1. a mandatory CI gate enforced from the canonical runtime-edge domains; and
2. a domain-based acceptance gate driven by mandatory scenarios plus domain-scoped coverage evidence.
The canonical domains SHALL be:
@@ -61,6 +61,7 @@ No PR that changes the observable contract of a canonical domain SHALL be accept
- an explicit justification that the observable contract did not change.
Improved aggregate coverage SHALL NOT be accepted as sufficient evidence on its own when the changed behavior belongs to a canonical domain with mandatory scenarios.
Workspace-wide aggregate coverage MAY still be generated as a report artifact, but it SHALL NOT be the authoritative CI acceptance gate.
## Rationale
@@ -100,11 +101,12 @@ The correct role of coverage is supporting evidence, not sole authority.
## Invariantes / Contrato
### Global Coverage Contract
### CI Coverage Contract
- CI MUST keep a workspace-wide coverage gate.
- The current `llvm-cov` based global gate remains valid as the operational baseline.
- CI MUST enforce coverage from the canonical runtime-edge domains instead of a workspace-wide aggregate percentage.
- The current `llvm-cov` toolchain remains valid as the operational baseline.
- Changing the tooling is out of scope for this decision.
- The authoritative quantitative CI gate is each domain `baseline_percent`, evaluated against domain `lines` coverage.
### Domain Gate Contract
@@ -188,13 +190,15 @@ Mandatory scenarios:
### Tooling / CI
- Existing `llvm-cov` and Jenkins integration remain valid.
- Future plans may add domain reporting, thresholds, or helper commands without changing this baseline decision.
- Jenkins MUST call repository helpers that compute and enforce the domain coverage gate.
- Workspace aggregate reports may continue to be published for inspection, but they are not the merge gate.
## Referencias
- `AGD-0001`
- `Makefile`
- `files/config/Jenkinsfile`
- `files/config/runtime-edge-coverage-domains.json`
- `docs/specs/runtime/12-firmware-pos-and-prometeuhub.md`
- `crates/console/prometeu-system/src/virtual_machine_runtime/tests.rs`
- `crates/console/prometeu-system/src/services/fs/virtual_fs.rs`
@@ -202,8 +206,8 @@ Mandatory scenarios:
## Propagacao Necessaria
- Create an execution plan that turns the domain model into concrete work items.
- Create or revise execution plans that turn the domain model into concrete CI and review work items.
- Define how domain evidence will be gathered during review.
- Decide whether to add helper commands or scripts for domain-oriented coverage inspection.
- Keep helper commands or scripts as the canonical interface for domain-oriented coverage inspection and CI enforcement.
- Prioritize firmware and host-dependent expansion first.
- Define an incremental split strategy for the monolithic runtime test suite.
@@ -21,7 +21,7 @@ Its goal is to turn the decision into concrete review and CI mechanics without c
Define the repository-level mechanics for:
- global coverage gate continuity;
- domain coverage gate enforcement in CI;
- domain-scoped coverage evidence during review;
- baseline tracking that can start at `0` per domain and tighten later;
- reviewer-visible rules for when domain tests are mandatory.
@@ -29,7 +29,7 @@ Define the repository-level mechanics for:
## Escopo
- Add repository commands or scripts for domain-oriented coverage evidence collection.
- Add repository-facing documentation that explains the global gate plus domain evidence workflow.
- Add repository-facing documentation that explains the domain gate plus domain evidence workflow.
- Align CI/coverage outputs with the new governance model without replacing `llvm-cov`.
## Fora de Escopo
@@ -51,7 +51,8 @@ Add one repository-visible command path that produces:
- existing global HTML/XML/JSON coverage artifacts;
- a documented procedure for mapping changed files/modules to one of the canonical domains;
- an initial baseline format that records per-domain coverage starting from `0`.
- an initial baseline format that records per-domain coverage starting from `0`;
- a CI-friendly command that fails when a domain baseline is not met.
**File(s):**
- `Makefile`
@@ -68,7 +69,7 @@ Prefer simple wrappers over new tooling. For example:
- capture `llvm-cov` JSON/HTML consistently;
- filter or summarize target files/modules for a domain;
- emit review-friendly evidence artifacts without changing the authoritative global gate.
- emit review-friendly evidence artifacts while also enforcing the authoritative domain gate.
**File(s):**
- `Makefile`
@@ -86,6 +87,7 @@ Document that any PR touching a canonical domain must either:
- justify why the observable contract did not change.
Document that domain coverage evidence is mandatory review input even when domain thresholds are still at baseline `0`.
Document that Jenkins consumes the repository helper target directly instead of re-implementing the gate inline.
**File(s):**
- `README.md`
@@ -94,10 +96,10 @@ Document that domain coverage evidence is mandatory review input even when domai
### Step 4 - Align CI outputs with the governance model
**What:**
Make the existing coverage pipeline clearly compatible with domain review.
Make the existing coverage pipeline clearly compatible with domain review and domain-based CI failure.
**How:**
Keep the current global Jenkins gate unchanged while ensuring produced artifacts are sufficient for domain inspection.
Make Jenkins call a repository helper target that runs the coverage pipeline, produces the existing artifacts, and fails from domain baselines.
If needed, archive additional summaries or helper outputs generated by the new scripts.
**File(s):**
@@ -106,10 +108,10 @@ If needed, archive additional summaries or helper outputs generated by the new s
## Criterios de Aceite
- [ ] The repository exposes a documented way to collect domain-oriented coverage evidence without replacing the global `llvm-cov` gate.
- [ ] The repository exposes a documented way to collect domain-oriented coverage evidence and enforce domain baselines in CI.
- [ ] Review guidance explicitly states when domain tests are mandatory.
- [ ] Domain baselines are represented in a form that can start at `0` and increase later.
- [ ] Existing global coverage enforcement remains intact.
- [ ] Jenkins uses a repository-owned helper target for the coverage gate.
## Tests / Validacao
@@ -122,9 +124,10 @@ If needed, archive additional summaries or helper outputs generated by the new s
- Show that the global coverage artifacts still build.
- Show an example of domain evidence collection for at least one domain.
- Show that the domain gate fails when a baseline is missed.
## Riscos
- Overdesigning domain evidence collection before real reviewer usage patterns exist.
- Accidentally creating a second competing coverage authority instead of a reviewer aid.
- Letting Jenkins re-encode policy logic instead of consuming the repository helper target.
- Spreading policy text across too many documents and making the rule hard to find.