Skip to content

refactor: consolidate final mechanical audit paths - #125165

Merged
steipete merged 1 commit into
mainfrom
steipete/w3-final-trio
Aug 17, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/w3-final-trio

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Three runtime paths still duplicated ownership that already had a canonical lightweight or SDK surface: Microsoft Teams repeated setup and directory policy in its full channel runtime, models.json preparation rediscovered the same config/workspace/agent/environment/plugin facts at multiple layers, and Nostr retained a private fixed-window limiter beside the Plugin SDK owner.

Why This Change Was Made

  • Compose the Microsoft Teams runtime from msteamsSetupPlugin and msteamsDirectoryContractPlugin, then overlay only full-runtime hooks. This follows the lightweight-descriptor pattern and prevents setup/directory policy drift without making the light artifacts depend on the full channel runtime.
  • Prepare one models-config context at each public entry boundary and thread it through fingerprinting and planning. The context carries the resolved config views, agent/workspace directories, runtime environment, plugin metadata snapshot, and discovery options.
  • Replace the remaining Nostr bus import with openclaw/plugin-sdk/webhook-ingress and delete the private limiter.

The Nostr limiter has no user-visible throttling delta: both implementations use the same fixed-window threshold and the same valid production settings. The SDK owner prunes expired keys on a bounded cadence instead of scanning every request; an expired key still starts a fresh window immediately, while the memory-entry metric may retain other expired keys until the next prune interval.

User Impact

No configuration or protocol changes. Microsoft Teams setup/directory behavior and Nostr accept/reject thresholds remain unchanged. Models catalog preparation performs each environmental and plugin-metadata resolution once per entry call.

Production LOC: +102/-353 (net -251) | Tests/test support: +93/-39 (net +54) | Total net: -197

Evidence

  • pnpm test extensions/msteams/src/channel.test.ts — 33 passed
  • pnpm test extensions/nostr/src/nostr-bus.inbound.test.ts — 29 passed
  • pnpm test src/agents/models-config.write-serialization.test.ts src/agents/models-config.runtime-source-snapshot.test.ts src/agents/models-config.provider-policy-registry.test.ts src/agents/models-config.applies-config-env-vars.test.ts src/agents/models-config.uses-first-github-copilot-profile-env-tokens.test.ts — 53 passed across two shards
  • pnpm check:changed — passed all selected core/core-test/extension/extension-test gates
  • .agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output — clean; no accepted/actionable findings
  • git diff --check — clean

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 17, 2026 08:13
@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Aug 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 4:19 AM ET / 08:19 UTC.

ClawSweeper review

What this changes

The PR reuses Microsoft Teams lightweight setup and directory artifacts, replaces Nostr’s private limiter with the Plugin SDK limiter, and threads one prepared context through models catalog planning.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. This maintainer-labeled PR is a behavior-neutral consolidation, and current main still has the duplicated models-config preparation; source review found no blocking correctness or security defect.

Priority: P3
Reviewed head: 1ce9049fc334d7f8f476dffaa6aaf870f714f301

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Source and focused test coverage support a clean consolidation; exact-head checks remain the normal merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored, behavior-neutral refactor is outside the external-contributor real-behavior-proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored, behavior-neutral refactor is outside the external-contributor real-behavior-proof gate.
Evidence reviewed 6 items Models-config owner boundary: The PR prepares config, environment, workspace, and plugin metadata once, then reuses that context for fingerprinting and planning.
Current-main necessity: Current main separately builds the fingerprint, resolves plugin metadata again, and constructs the planner input, so the central consolidation is not already implemented.
Teams composition: The full Teams channel spreads the existing setup artifact and directory callbacks, preserving its runtime-specific hooks; the focused test asserts the shared callback identities.
Findings None None.
Security None None.

How this fits together

Bundled channels combine lightweight plugin metadata with transport-specific runtime behavior. The models-config pipeline combines configuration, environment, authentication, and plugin metadata into generated model catalogs, while Nostr ingress rate-limits events before costly handling.

flowchart LR
A[Config and environment] --> B[Prepared model context]
B --> C[Generated model catalogs]
D[Teams setup and directory] --> E[Teams channel runtime]
F[Nostr incoming event] --> G[Shared ingress limiter]
G --> H[Validated message handling]
Loading

Before merge

  • Complete next step (P2) - No repair is identified; normal exact-head validation is the remaining merge step.
Agent review details

Security

None.

PR surface

Source -222, Tests +25. Total -197 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 6 148 370 -222
Tests 3 47 22 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 195 392 -197

Review metrics

Metric Value Why it matters
Production vs test LOC production +102/-353 (net -251); tests/test support +93/-39 (net +54) The refactor deletes substantially more runtime code than it adds while adding focused contract coverage.

Stored data model

Persistent data-model change detected: serialized state: src/agents/models-config.write-serialization.test.ts, vector/embedding metadata: extensions/msteams/src/channel.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one canonical lightweight setup/directory surface and one prepared models-config context, then merge after exact-head required checks complete.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR refactors established paths rather than reporting a user-visible defect.

Is this the best way to solve the issue?

Yes. Reusing existing lightweight artifacts and the shared SDK limiter removes parallel ownership without adding a configuration or protocol surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d6b2e14f6333.

Labels

Label changes:

  • add P3: This is a behavior-neutral internal cleanup with no demonstrated user-facing regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored, behavior-neutral refactor is outside the external-contributor real-behavior-proof gate.

Label justifications:

  • P3: This is a behavior-neutral internal cleanup with no demonstrated user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored, behavior-neutral refactor is outside the external-contributor real-behavior-proof gate.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the current PR and the recent setup, limiter, and models-config lines traced by blame/history. (role: recent area contributor; confidence: high; commits: 1ce9049fc334, e84a45e28ecf, 9e4381eb1c8c; files: extensions/msteams/src/channel.setup.ts, src/plugin-sdk/webhook-memory-guards.ts, src/agents/models-config.ts)
  • Jesse Merhi: The channel-owned setup-contract history includes the original feature commit. (role: setup-contract feature contributor; confidence: medium; commits: 4a2a6008091d; files: extensions/msteams/src/channel.setup.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Allow the exact-head required checks to complete before merging.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification for 1ce9049fc334d7f8f476dffaa6aaf870f714f301:

  • pnpm test extensions/msteams/src/channel.test.ts — 33 passed
  • pnpm test extensions/nostr/src/nostr-bus.inbound.test.ts — 29 passed
  • focused models-config tests — 53 passed across two shards
  • pnpm check:changed — passed all selected core, core-test, extension, and extension-test gates
  • Codex autoreview — clean; no accepted/actionable findings
  • exact-head CI run 32009322563 — GREEN
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 125165 — hosted exact/recent-parent gates passed; prep head remains byte-identical to the PR head
  • ClawSweeper — P3, no findings; its sole optional rank-up move was completion of exact-head checks, now satisfied

Known proof gap: no live MSTeams or Nostr provider session was run because this is a behavior-neutral ownership refactor with no external API change. Focused owner-boundary tests verify callback identity and fixed-window rate-limit outcomes.

@steipete
steipete merged commit fb0e8b1 into main Aug 17, 2026
276 of 280 checks passed
@steipete
steipete deleted the steipete/w3-final-trio branch August 17, 2026 08:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant