8000 Adopt Agent Workflow with Node policy and light documentation handling by rore · Pull Request #38 · rore/minimap · GitHub
[go: up one dir, main page]

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
555 changes: 555 additions & 0 deletions .agent-redline/agent-policy.schema.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .agent-redline/suppressions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copied to .agent-redline/suppressions.yaml during Node bootstrap.
suppressions:
inlineComments:
- "// @ts-ignore"
- "// @ts-nocheck"
- "// eslint-disable"
- "/* eslint-disable"
- "// nosemgrep"
5 changes: 5 additions & 0 deletions .agent-workflow/tasks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Work Records

Use one `{slug}.md` file per non-exempt task. Derive the slug from the task branch name, remove its common prefix, and replace remaining `/` characters with `-`.

Follow [operating mode](../../.agents/skills/agent-workflow/operating-mode.md) and use its compact or expanded Work Record template as directed.
96 changes: 96 additions & 0 deletions .agent-workflow/tasks/bootstrap-minimap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!-- agent-workflow:start -->
**Outcome:** Install Agent Workflow and its Node Redline profile in Minimap.
**Target:** minimap, feat/adopt-agent-workflow
**Scope:** Bootstrap inspection and approved installation of identical skills, configs, policy, checker and runtime adapters, owned agent guidance, checkpoint documentation, and CI workflow if confirmed.
**Constraints:** Preserve existing instructions and tests. Keep roadmap files canonical. No application behavior changes or shared-server restart. Do not modify branch protection or CODEOWNERS; propose them. Obtain bootstrap policy and CI confirmations before installation.
**Completion criteria:** Approved repository-specific Node policy, complete matching skill installations, valid configuration, successful backend probe, documented runtime coverage limits, bootstrap summary, and green resulting PR checks.
**Requirement baseline:** {"source":"work-record-initial","outcome":"Install Agent Workflow and its Node Redline profile in Minimap.","scope":"Bootstrap inspection and approved installation of identical skills, configs, policy, checker and runtime adapters, owned agent guidance, checkpoint documentation, and CI workflow if confirmed.","constraints":"Preserve existing instructions and tests. Keep roadmap files canonical. No application behavior changes or shared-server restart. Do not modify branch protection or CODEOWNERS; propose them. Obtain bootstrap policy and CI confirmations before installation.","completion_criteria":"Approved repository-specific Node policy, complete matching skill installations, valid configuration, successful backend probe, documented runtime coverage limits, bootstrap summary, and green resulting PR checks."}
**Risk:** High
**Complexity:** Moderate
**Reason:** Bootstrap changes governance and CI for a canonical package with live consumers.
**Discovery:** Inspecting released Agent Workflow 468f1d5fa5cf856bfd45ebb4ff041bbacc714b02 and Minimap's current source, tests, instructions, and GitHub rules.
**Material assumptions:** Node zone-only profile fits the owned JavaScript packages. Verify manifests and existing boundary tools; stop and revise if evidence contradicts this.
**Plan:** Follow bootstrap phases: inspect, propose, adapt, write, confirm CI, self-summary. Obtain required confirmations at phase boundaries.
**Verification plan:** Approved Node policy -> configuration and policy schema validation. Complete skill installations -> both manifests and source-byte comparison. Backend reachability -> installed adapter probe with real reporter evidence. Documentation exemptions -> positive documentation-only and negative mixed-change checks. Delivery -> resulting PR test, redline, and agent-workflow checks. Runtime limits -> record native hooks as degraded unless actual interception is demonstrated.
**Plan review:** Agent technical review: /root/bootstrap_review. Approved Phase 4 on 2026-10-01 after inspecting the record, both configuration drafts, repository instructions and CI. Preserve pending behaviorContracts until combined harness evidence, test documentation-only versus mixed-change applicability, and identify the external interpreter in probe evidence. No unresolved installation findings.
**Approvals:** Approved by user 2026-10-01: "yes, and also relax documentation only changes". Approval covers the presented Node shadow policy direction, workflow behavior protection, ordinary-documentation relaxation, and read-only calibration. Approved by user 2026-10-01: "yes, go" in response to the explicit CI installation proposal. Approved by user 2026-10-01: "approve" for adoption result and architecture-reviewed label.
**Exceptions:** —
**State:** Ready for review
<!-- agent-workflow:end -->

## Implementation

Bootstrap record created before repository inspection. Approved policy, configuration, skills, and local adapters are now installed. CI installation was separately approved and completed.

## Phase 1 findings

User confirmed Phase 1 on 2026-10-01: "ok, let's go". Preparing inert Phase 2 drafts; no active configuration or hooks written.

- Existing Agent Workflow/Redline: absent. Existing agent instructions: root AGENTS.md; preserve them.
- Source package: package/minimap/package.json (ES modules, cli.js bin), root package.json drives CI. Two skill runtime copies are generated, not additional owned packages.
- Authoritative sources: roadmap/ feature and scope files; package/minimap/CONTRACT.md; packaged skill instructions and references. Architecture/layout guidance is in AGENTS.md. No standalone decisions ledger found in the inspected tracked documentation.
- CI: .github/workflows/ci.yml, Node 22, npm test, Playwright, mirror parity. PR-driven: 30 recent merged PRs inspected, 74 commits in the three-month window.
- Protection: main has an active ruleset requiring test and an up-to-date branch. Classic protection endpoint returns 404; the ruleset still protects main. No CODEOWNERS found. Owner is a user account, so the org-scoped tuner does not apply.
- Extension: node, zone-only; no existing import-boundary backend, TypeScript/bundler configuration, YAML formatter gate, or pre-push hook found.
- Behavior-contract candidates: package/minimap/CONTRACT.md, packaged skill references, test/source-bound*.test.js, test/sessions-atomic.test.js, test/runtime-compatibility.test.js, test/restart-race.test.js, test/sync-mirrors.test.js, and playwright/*.spec.js. Existing test check executes the test suites, but combined harness evidence and protection choice remain unresolved. These are candidates, not an installed policy.
- Documentation-only exemption candidates for review: README.md and ordinary roadmap planning edits. Contract changes, acceptance-criteria changes, agent instructions, and governance are not automatically exempt. Direct-main exemption is disallowed by existing protection.
- Watch candidates: manifests/lockfile, playwright.config.js, CI, and both runtime mirrors. Generated copies remain classified and parity remains enforced.
- Phase 1 deferred choices were subsequently resolved in Phase 2/3 below; separate CI installation confirmation remains pending.

## Phase 2 and 3

User approved the proposed policy direction and workflow protection, adding relaxed documentation-only handling. The checker emitted an approved exemption fragment for README.md, roadmap/board.md, docs/images/, and docs/demo-spec/: workflowRequired=false, directDefaultBranchAllowed=false. Feature requirements, acceptance criteria, normative contracts, and agent instructions remain outside this exemption. Active policy installation follows technical review; selected behavior-contract enforcement remains pending combined PR harness evidence and CI confirmation.

Existing interpreter C:/Dev/rore/agent-workflow/.venv/Scripts/python.exe provides Python, PyYAML, and jsonschema. No dependencies were installed. Direct adapter success will not be described as native hook coverage.

## Phase 4 evidence

- Installer: /root/bootstrap_install. Both skill manifests and all 140 listed entries match the released source in size and content. Configuration and policy schemas pass. Hook installation is idempotent; pre-existing AGENTS.md content is preserved.
- Real Redline reporter evidence verifies approved-only documentation exits 0 without a Work Record. README mixed with a feature requirement, CONTRACT.md, or generated runtime exits 2 and requires a Work Record.
- The documented backend-probe command omits the required Redline verdict. Initial probe blocked for that reason; retry through the installed PowerShell adapter with the explicit external interpreter and real reporter evidence exited 0 without weakening policy. Temporary probe files were cleaned. Native interception remains unverified/degraded.
- Read-only policy calibration completed successfully over 30 merged PRs. Existing contract references and Playwright paths each fired in 18/30 PRs; new harness paths naturally had no prior matches. Keep the approved rules; no automatic demotions applied. CODEOWNERS inference was inconclusive and remains a placeholder proposal.
- CI proposal is prepared for review. No workflow, branch-protection, or CODEOWNERS changes have been applied.

## Phase 5

User approved installing the proposed combined CI workflow on 2026-10-01. Branch protection and CODEOWNERS remain proposal-only. Behavior-contract enforcement remains pending evidence from the combined PR checks.

The full staged-diff reporter detected ten literal pattern definitions in the two bundled Node suppressions.yaml data files. These are not application suppressions. No exemption was added: the existing architecture-review checkpoint remains pending human result review. Scoped LF attributes preserve vendored manifest bytes on Windows; deployed shell entry points carry executable Git modes.

## Evidence

Local checker against the complete staged diff: advisory (exit 1), with no blocking workflow predicates. Reporter: exit 2 for the unsatisfied suppression checkpoint described above. This is not a passing CI claim. Package/schema/probe and mixed-documentation checks are recorded in docs/agent-workflow-bootstrap-summary.md. PR execution remains pending.

## Skill feedback (unsent)

**Affected surface:** agent-workflow bootstrap-mode.md Phase 6, release 468f1d5fa5cf856bfd45ebb4ff041bbacc714b02.

**Expected:** The documented backend probe succeeds after the prescribed installation.

**Actual:** The command omits a Redline verdict while the generated configuration requires one; the checker blocks on missing risk evidence.

**Minimal reproduction:** Bootstrap a repository with redline required, create the prescribed temporary Work Record, and run the documented adapter check without a verdict.

**Evidence:** The literal probe exited 2 for missing Redline findings. Supplying a real reporter-generated verdict made the same installed adapter exit 0.

**Suggested owner:** bootstrap-mode.md probe instructions. Include reporter preparation and pass its output to the adapter. Related documentation ambiguity: combined bootstrap names docs/agent-redline/skills while nested Redline guidance names docs/agent; this install follows the combined bootstrap.

Additional repeatable upstream defect: the combined CI template passes only changed filenames, not unified diff or per-file line counts. Thus suppression detection silently returns no findings and changed-line thresholds lack data. PR 38's first Redline run passed while the local full-diff reporter correctly surfaced literal marker definitions. Minimal repair: generate both inputs from the existing merge base and pass --diff-unified and --lines-per-file; retain all gates.

## Result review

Agent technical review: /root/bootstrap_review.

Reviewed revision: staged tree 0b30612e8b49e6d7550ee7c207725241c1ac2fa7 (adoption code in 73db5ed), followed by the four-line CI evidence correction in 2b17da3.

Verification adequacy: reviewer confirmed focused schema, byte-identity, applicability and adapter checks are adequate for harness-only adoption. Scoped LF attributes and shell executable modes closed the one integration finding. Follow-up review approved the four-line CI correction: same merge-base-to-head range, supported reporter flags, unchanged gates, no bypass. Native coverage remains degraded; corrected PR execution and human result review remain pending.

PR evidence: https://github.com/rore/minimap/pull/38. First Redline job passed but lacked diff inputs; not accepted as suppression-check evidence. Existing application test and workflow jobs were still running at inspection.

No public report submitted; public submission approval is absent.

## Final approval and activation

Approved by user 2026-10-01: "approve" for the adoption result and architecture-reviewed label. Label applied to PR 38. The existing test check passed on a03661e; combined Redline and workflow jobs executed on that PR. Activated the previously approved behaviorContracts block unchanged from the reviewed draft. Final revision checks must still pass before merge. No platform protection or CODEOWNERS changes made.

Final technical review /root/bootstrap_review confirmed activated behaviorContracts equals the approved eight-path workflow/test draft exactly, with no scope expansion. Local complete-diff reporter and checker exit 1 (advisory); no blocking predicates. The commit-order advisory is expected: this Work Record was written before implementation but committed alongside the installation.
38 changes: 38 additions & 0 deletions .agents/skills/agent-workflow/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: agent-workflow
description: Use for implementation plans or repository changes, explicit Agent Workflow requests, and existing workflow task actions. Skip standalone read-only review, explanation, diagnosis, comparison, or inspection.
---

# agent-workflow

Drive engineering tasks through a small set of checkpoints. The harness records what you do in a structured Work Record so the next agent or reviewer can pick up where you stopped. Plan quality, discovery sufficiency, implementation correctness, evidence adequacy — those stay reviewer judgments; you produce the artifacts that make them possible.

## Pick a mode

1. **`agent-workflow.yaml` exists in the repo root** → read [`operating-mode.md`](operating-mode.md). Everyday work.
2. **User asked you to set up `agent-workflow` on this repo** → read [`bootstrap-mode.md`](bootstrap-mode.md). One-shot install.
3. **Neither** → this skill is not relevant.

Read only the file for the mode that applies.

## Principles

- **Gate request scope, then applicability.** Standalone read-only analysis stays out; implementation plans, repository changes, explicit use, and existing-task actions enter. For in-scope work, only a whole-change applicability exemption skips the Work Record.
- **Shape is derived from `(Risk, Complexity)`.** `(Routine, Simple)` → compact. Anything else → expanded. Checker enforces via `workrecord.shape_matches_classification`.
- **Stay within recorded scope.** Material scope expansion returns the task to planning.
- **Update State at transitions.** `Ready to implement` → `Ready for review` only when verification passes.
- **Pause on assumption failure.** Stop and update the assumption + affected fields. Do not continue under stale assumptions.
- **Marker block is the structured surface.** Prose around it is human notes. Don't put structured state outside the markers; don't put free prose inside them.
- **Report upstream defects.** If product/skill behavior fails, contradicts guidance, or forces a consequential guess, load [`templates/skill-feedback.md`](templates/skill-feedback.md). Review the Result is the final catch.

## Decision priority

When ambiguous: repo's `agent-workflow.yaml` → repo's `AGENTS.md`/`CLAUDE.md` → mode-specific skill file → these principles → ask the developer. Do not invent rules the config does not state.

## Resources (load on demand)

- `operating-mode.md` — when entering operating mode.
- `bootstrap-mode.md` — when entering bootstrap mode.
- `templates/checkpoints/*.md` — per-checkpoint, load only when entering that checkpoint.
- `templates/skill-feedback.md` — load only when a trigger from the Skill-feedback check fired.
- The repo's `agent-workflow.yaml` — once on pickup, to learn the configured `taskPath`.
55 changes: 55 additions & 0 deletions .agents/skills/agent-workflow/agent-redline/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: agent-redline
description: Use when setting up agent governance for a repo, or when working in a repo that contains agent-redline-policy.yaml. Classifies structural risk and routes human attention to red-zone changes.
---

# agent-redline

You classify changes before editing. Deterministic CI checks (a boundary-rule backend, the reporter) catch what you miss.

## Vocabulary

| Term | Meaning |
|---|---|
| **Red zone** | Changes are dangerous: contracts, modeling, architecture, security, persistence, shared behavior. |
| **Blue zone** | Autonomous work fine: isolated, replaceable, strongly testable, low blast-radius. |
| **Gray zone** | Unclassified. Cautious by default. |
| **Watch** | Additive tag (not a zone): paths surfaced in the PR comment regardless of red/blue/gray classification. No checkpoint, no gate — visibility only. |
| **Boundary rule** | Deterministic dependency rule (`X must not import Y`). Enforced by a backend (e.g., ArchUnit). |
| **Checkpoint** | Required human attention; satisfied by a label or CODEOWNER approval. Types: `architecture-review`, `api-review`, `persistence-review`, `security-review`, `ops-review`. |

## Pick a mode

1. **`agent-redline-policy.yaml` exists in the repo root** → read [`operating-mode.md`](operating-mode.md). Everyday work.
2. **The user asked you to set up agent-redline** → read [`bootstrap-mode.md`](bootstrap-mode.md). One-time setup.
3. **Neither** → this skill is not relevant.

Read only the file for the mode that applies.

## Principles (non-negotiable)

1. **Classify before editing.** Decide blue / red / gray before you touch a file; note any `watch` paths to surface in the PR.
2. **Refuse boundary shortcuts.** If a change would create a forbidden dependency, fix the structure or escalate. Do not suppress, do not modify the architecture-test files, do not launder the import.
3. **Architecture-test files are red.** Any change to the boundary-rule backend's definition files (e.g., ArchUnit test classes) requires `architecture-review`, regardless of what the policy says.
4. **Never auto-commit CI changes.** Workflows, branch protection, CODEOWNERS — propose, don't commit.
5. **Default conservative on uncertainty.** Gray > blue, red > gray, boundary risk > everything.
6. **No slop.** Tight PR descriptions, tight code comments. What's not obvious from the code, and what it does.

## Decision priority

When ambiguous:

1. The repo's `agent-redline-policy.yaml`
2. The repo's `AGENTS.md` / `CLAUDE.md` / `GEMINI.md`
3. The active language extension's `operating.md` (if present)
4. These principles
5. Ask the developer

Do not invent rules the policy doesn't state.

## Resources (load on demand)

- `operating-mode.md` — read when entering operating mode
- `bootstrap-mode.md` — read when entering bootstrap mode
- Active extension's files in `extensions/<name>/` — `profile.md` and `scaffold.md` during bootstrap; `operating.md` once per session in operating mode if present
- `docs/agent/` in the consuming repo — read a per-checkpoint doc only when escalating to that checkpoint
Loading
Loading
0