feat: schedule local workspace verification
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
# Jenkins Workspace Verification
|
||||
|
||||
The root `Jenkinsfile` runs a read-only `verify --all` against the existing Windows multi-repository workspace. It detects stale generated documents, missing registered repositories, invalid profiles, and contract composition failures. It never composes files or performs Git operations.
|
||||
|
||||
## Windows node setup
|
||||
|
||||
Configure one Jenkins Windows node with:
|
||||
|
||||
- the label `agent-harness`;
|
||||
- Node.js 20 or newer on `PATH`;
|
||||
- every registered repository available in the established workspace layout;
|
||||
- the node environment variable `KRI_DEV_ROOT` set to the absolute multi-repository workspace root.
|
||||
|
||||
Do not store the absolute workspace path, credentials, or tokens in this repository. The node-level environment variable owns the machine-specific path.
|
||||
|
||||
The local central harness clone must remain at `_________AgentHarnessBase` directly below `KRI_DEV_ROOT`. The pipeline deliberately skips the default Jenkins checkout and reads this existing clone so the relative paths in `workspace.yml` resolve to the sibling repositories.
|
||||
|
||||
## Jenkins job setup
|
||||
|
||||
Create a Pipeline job using Pipeline script from SCM:
|
||||
|
||||
- repository: the central Agent Harness repository;
|
||||
- branch: `master`;
|
||||
- script path: `Jenkinsfile`.
|
||||
|
||||
Assign the job only to the node carrying the `agent-harness` label. The pipeline runs automatically once per weekday at a hashed minute during the 08:00 hour in `Asia/Seoul`, and it may also be run manually.
|
||||
|
||||
The job does not fetch or update the repositories under `KRI_DEV_ROOT`. Keep that workspace synchronized using the existing repository update process before relying on the scheduled result.
|
||||
|
||||
## Local verification
|
||||
|
||||
From the central harness repository:
|
||||
|
||||
```powershell
|
||||
npm.cmd run verify:workspace
|
||||
```
|
||||
|
||||
To supply the workspace root explicitly:
|
||||
|
||||
```powershell
|
||||
.\scripts\verify-workspace.ps1 -WorkspaceRoot <workspace-root>
|
||||
```
|
||||
|
||||
Both forms execute the committed `dist\cli.cjs` bundle and require no package installation.
|
||||
|
||||
## Failure handling
|
||||
|
||||
Treat a failed build as a drift report, not as authorization for automatic repair:
|
||||
|
||||
1. identify the missing, invalid, or stale project in the console output;
|
||||
2. update the authoritative `.agent` source when a rule changed;
|
||||
3. run `plan` and obtain approval for the affected repositories;
|
||||
4. run the narrowest applicable `compose` command;
|
||||
5. run `verify` again and commit each repository independently after approval.
|
||||
|
||||
The Jenkins job must not compose documents, commit, push, pull, fetch, or modify credentials.
|
||||
54
docs/local-scheduling.md
Normal file
54
docs/local-scheduling.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Local Scheduled Workspace Verification
|
||||
|
||||
The Windows Task Scheduler runs the same read-only workspace verification as the manual command. It does not compose documents, update repositories, perform Git operations, or access the network.
|
||||
|
||||
## Manual verification with a retained log
|
||||
|
||||
Run the scheduled-verification wrapper directly before registering the task:
|
||||
|
||||
```powershell
|
||||
npm.cmd run verify:scheduled
|
||||
```
|
||||
|
||||
Each execution stores a UTF-8 log below `.local/verification-logs`. The directory is ignored by Git, and logs older than 30 days are removed after an execution finishes.
|
||||
|
||||
## Register the weekday task
|
||||
|
||||
Register the task for the current Windows user:
|
||||
|
||||
```powershell
|
||||
npm.cmd run schedule:install
|
||||
```
|
||||
|
||||
The default task is named `KRI Agent Harness Workspace Verify` and runs Monday through Friday at 08:30. It uses one process at a time, retries a failed task up to three times, and runs a missed schedule when the signed-in user becomes available.
|
||||
|
||||
The task uses an interactive, limited Windows principal. The computer must be running and the registered user must be signed in before the process can execute.
|
||||
|
||||
To use a different time, call the registration script directly with an `HH:mm` value:
|
||||
|
||||
```powershell
|
||||
.\scripts\register-scheduled-verification.ps1 -At <HH:mm>
|
||||
```
|
||||
|
||||
## Remove the task
|
||||
|
||||
```powershell
|
||||
npm.cmd run schedule:uninstall
|
||||
```
|
||||
|
||||
Removing the task does not remove retained verification logs.
|
||||
|
||||
## Result handling
|
||||
|
||||
Task Scheduler records the verification process exit code:
|
||||
|
||||
- `0`: all registered Agent Harness documents are current;
|
||||
- non-zero: a missing repository, invalid profile, stale generated document, or another verification error was detected.
|
||||
|
||||
Treat a failed task as a drift report, not as authorization for automatic repair:
|
||||
|
||||
1. inspect the newest log in `.local/verification-logs`;
|
||||
2. update the authoritative `.agent` source when a rule changed;
|
||||
3. run `plan` and obtain approval for affected repositories;
|
||||
4. run the narrowest applicable `compose` command;
|
||||
5. run the verification again and commit each repository independently after approval.
|
||||
Reference in New Issue
Block a user