@soleur/opencode 3.354.26 → 3.354.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -438,7 +438,7 @@ export function stripComments(text: string): string {
438
438
  }
439
439
 
440
440
  /** The view every declaration parser reads: comments removed AND heredoc bodies blanked. */
441
- function codeView(text: string): string {
441
+ export function codeView(text: string): string {
442
442
  return scanHcl(text, true);
443
443
  }
444
444
 
@@ -515,7 +515,7 @@ function expressionEnd(text: string, start: number, limit: number, stopAtComma =
515
515
  * (`lifecycle {…}`, `validation {…}`, `request_headers {…}`) are skipped whole, so an attribute
516
516
  * inside them is never read as the block's own.
517
517
  */
518
- function topLevelAttributes(body: string): Map<string, string> {
518
+ export function topLevelAttributes(body: string): Map<string, string> {
519
519
  const out = new Map<string, string>();
520
520
  const limit = body.length - 1; // exclude the closing brace
521
521
  const attr = /[ \t\r\n]*([A-Za-z_][A-Za-z0-9_-]*)[ \t]*=(?!=)[ \t]*/y;
@@ -569,7 +569,7 @@ const LABEL = '(?:"([A-Za-z_][A-Za-z0-9_-]*)"|([A-Za-z_][A-Za-z0-9_-]*))';
569
569
  /** A block keyword only at the start of input or after whitespace / a brace (never mid-identifier). */
570
570
  const HEADER_START = "(?<![^\\s{}])";
571
571
 
572
- function resourceBlocks(code: string, type: string): { resourceName: string; body: string }[] {
572
+ export function resourceBlocks(code: string, type: string): { resourceName: string; body: string }[] {
573
573
  const header = new RegExp(`${HEADER_START}resource\\s+(?:"${type}"|${type}(?![A-Za-z0-9_-]))\\s+${LABEL}\\s*\\{`, "g");
574
574
  return labeledBlocks(code, header, (m) => `${type}.${m[1] ?? m[2]}`).map(({ m, body }) => ({ resourceName: m[1] ?? m[2], body }));
575
575
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soleur/opencode",
3
- "version": "3.354.26",
3
+ "version": "3.354.28",
4
4
  "description": "Soleur AI organization plugin for OpenCode",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env bun
2
+ // Discoverability probe for #11068: do all FIVE Inngest-serving Better Stack alert resources
3
+ // declare `push = true` in SOURCE? The flip is the measured-acceptance convention (#9168,
4
+ // #11001): email stays on, push is additive, and a vendor refusal at apply reverts the
5
+ // attribute — a silent source-level revert is exactly what this probe exists to catch.
6
+ //
7
+ // Credential-free and sub-second: it reads apps/web-platform/infra/*.tf only, through the same
8
+ // declaration-grade parser path the drift reconciler uses (codeView + resourceBlocks +
9
+ // topLevelAttributes — comments stripped, heredoc bodies blanked, nested blocks skipped, so
10
+ // only a REAL top-level `push = true` counts). It says nothing about the LIVE resources (a
11
+ // console-side toggle, a vendor refusal) — the merge-triggered apply-web-platform-infra run is
12
+ // that measurement.
13
+ //
14
+ // Standalone file, not a `bun -e` one-liner, because preflight Check 10 (ADR-175) runs the
15
+ // plan's discoverability command inside a sandbox behind a shell-active-token reject —
16
+ // the inngest-luks-alert-armed-probe.ts precedent.
17
+ //
18
+ // Exit 0 + "PUSH_ARMED" when all five declare `push = true`; exit 1 +
19
+ // "PUSH_MISSING <resource>" naming the first one that does not (or is absent).
20
+ import { closeSync, constants, fstatSync, openSync, readFileSync } from "node:fs";
21
+ import { join } from "node:path";
22
+
23
+ import { codeView, listTfFiles, resourceBlocks, topLevelAttributes } from "../lib/heartbeat-live-reconcile";
24
+
25
+ // argv[2] is a TEST seam only (a synthesized root); the plan's discoverability command
26
+ // passes nothing and reads the real root.
27
+ const INFRA_DIR = process.argv[2] ?? "apps/web-platform/infra";
28
+ const TARGETS: readonly (readonly [string, string])[] = [
29
+ ["logtail_exploration_alert", "inngest_luks_wrong_volume"],
30
+ ["logtail_exploration_alert", "inngest_step_524"],
31
+ ["betteruptime_heartbeat", "inngest_server_probe"],
32
+ ["betteruptime_heartbeat", "inngest_prd"],
33
+ ["betteruptime_heartbeat", "inngest_consumer"],
34
+ ];
35
+
36
+ const seen = new Set<string>();
37
+ const missing: string[] = [];
38
+ for (const file of listTfFiles(INFRA_DIR)) {
39
+ const path = join(INFRA_DIR, file);
40
+ // Check-then-read on ONE fd (open + fstat on the descriptor): a path-level
41
+ // lstat→readFileSync pair is the js/file-system-race TOCTOU shape. O_NONBLOCK
42
+ // keeps the open from hanging on a *.tf FIFO before fstat can refuse it.
43
+ const fd = openSync(path, constants.O_RDONLY | constants.O_NONBLOCK);
44
+ let code: string;
45
+ try {
46
+ if (!fstatSync(fd).isFile()) continue;
47
+ code = codeView(readFileSync(fd, "utf8"));
48
+ } finally {
49
+ closeSync(fd);
50
+ }
51
+ for (const [type, name] of TARGETS) {
52
+ if (seen.has(name)) continue;
53
+ const block = resourceBlocks(code, type).find((b) => b.resourceName === name);
54
+ if (block === undefined) continue;
55
+ seen.add(name);
56
+ if (topLevelAttributes(block.body).get("push") !== "true") {
57
+ missing.push(`${type}.${name}`);
58
+ }
59
+ }
60
+ }
61
+ for (const [type, name] of TARGETS) {
62
+ if (!seen.has(name)) missing.push(`${type}.${name}`);
63
+ }
64
+
65
+ console.log(missing.length === 0 ? "PUSH_ARMED" : `PUSH_MISSING ${missing[0]}`);
66
+ process.exit(missing.length === 0 ? 0 : 1);
@@ -844,21 +844,15 @@ Domain leaders are consulted at brainstorm time but not at ship time. The actual
844
844
 
845
845
  ### CMO Content-Opportunity Gate
846
846
 
847
- **Trigger:** PR matches ANY of: (a) touches files in `knowledge-base/product/research/`, `knowledge-base/marketing/`, or adds new workflow patterns (new AGENTS.md rules, new skill phases); (b) has a `semver:minor` or `semver:major` label; (c) title matches `^feat(\(.*\))?:` pattern.
847
+ **Trigger:** PR matches ANY of: (a) touches `knowledge-base/product/research/` or `knowledge-base/marketing/`, or adds a workflow pattern — a new `#{2,5}` heading or `references/` file under `plugins/soleur/skills/`, or new AGENTS.md rules; (b) would warrant `semver:minor`/`semver:major` by the Phase 6 diff analysis (new agents/skills/commands/components) — compute it from the diff, never read the label: Phase 6 applies it AFTER this gate, so a label read is structurally dead; (c) title normalized by stripping `^(WIP|Draft)[:\s-]*` matches `^feat\b`.
848
848
 
849
- **A resumed or manually-driven ship tail still runs this gate.** When ship is resumed after a dead runner, a context reset, or any path where the merge is driven by hand rather than by an uninterrupted Phase 5.5→Phase 7 flow, run this gate's detection BEFORE arming merge — the gate fires on diff state, not on session continuity, and a partial tail that skips it produces a merged PR with no content disposition (epic #10397's #10404 child shipped this way — retroactive brief filed as #10903).
849
+ **A resumed or manually-driven ship tail still runs this gate.** When ship is resumed after a dead runner, a context reset, or any path where the merge is driven by hand rather than by an uninterrupted Phase 5.5→Phase 7 flow, run detection BEFORE arming merge — the gate fires on diff state, not on session continuity (#10404 shipped disposition-less; retro brief #10903).
850
850
 
851
- **Detection:** Run `git diff --name-only origin/main...HEAD` and check file paths against trigger (a). Run `gh pr view --json labels,title` and check against triggers (b) and (c). If any trigger matches, proceed to "If triggered."
851
+ **Detection:** `git diff --name-only origin/main...HEAD` for the (a) paths, `git diff origin/main...HEAD -- plugins/soleur/skills/ | grep -qE '^\+#{2,5} '` for a new gate/section, and `gh pr view --json labels,title` for (c) after normalization.
852
852
 
853
- **If triggered:**
854
-
855
- 1. Spawn the CMO agent with a pre-ship content assessment prompt: "Assess content and distribution opportunities from this PR. What was produced, what data points are content-worthy, which channels should be used, and what's the recommended timing (ship with PR or schedule for later)? For any blog post, apply the brand guide's Channel Notes > Blog note."
856
- 2. Present the CMO's recommendations to the user.
857
- 3. **Interactive mode:** Ask "Create content now, schedule for later, or skip?" Options: Create now (invoke content-writer/social-distribute), Schedule (create a GitHub issue with content brief), Skip.
858
- 4. **Headless mode:** Auto-create a GitHub issue with the CMO's content brief for later action. Do not block the ship.
859
- 5. **Update content strategy (mandatory if content is scheduled or created).** When a content piece is identified (option 1 or 2 above), update `knowledge-base/marketing/content-strategy.md`: add the piece to the content pipeline table under the appropriate pillar AND insert it into the rolling quarterly calendar at the correct week. A GitHub issue without a content strategy entry is an orphan — it will be forgotten. **Why:** In #1173, a methodology blog post was created as issue #1176 but never added to the content strategy calendar, requiring a manual fix.
853
+ **If triggered:** Spawn the CMO agent: "Assess content and distribution opportunities from this PR. What was produced, what data points are content-worthy, which channels, recommended timing? Return `DISPOSITION: create-now | schedule | skip` plus angle, format, channels, and a one-line rationale. For a blog post, apply the brand guide's Channel Notes > Blog note." **The CMO's disposition is the decision — do not ask the operator to choose.** Execute it: `skip` → emit `SOLEUR_RULE_APPLIED rule=cmo-content-opportunity-decision disposition=skip angle=<rationale>`, no issue. `schedule` → file a GitHub issue with the brief AND update `knowledge-base/marketing/content-strategy.md` (pipeline table + rolling calendar — an issue without a strategy entry is an orphan, #1173). `create-now` → invoke `soleur:content-writer`/`soleur:social-distribute` per the brief, plus the same strategy entry. Emit the `SOLEUR_RULE_APPLIED` line either way so the disposition is auditable; the operator overrides by commenting on the filed issue, never by being asked.
860
854
 
861
- **Why:** In #1173, a research sprint produced a novel methodology with compelling data, but no content was planned because the CMO was only consulted when the scope was "should we explore this?" — not when the actual content existed.
855
+ **Why:** #1173 — a research sprint produced a novel methodology but no content was planned because the CMO was only consulted when the scope was "should we explore this?", not when the content existed. #11016 — a task-design-gate methodology PR shipped with no CMO consult at all: (a) read "new skill phases" but the diff added gate sections, (b) ran before the label existed, (c) failed on the `WIP:` title. A gate that silently never fires is worse than none.
862
856
 
863
857
  ### CMO Website Framing Review Gate
864
858
 
@@ -866,12 +860,7 @@ Domain leaders are consulted at brainstorm time but not at ship time. The actual
866
860
 
867
861
  **Detection:** Run `git diff --name-only origin/main...HEAD` and check for `brand-guide.md`. If present, check `git diff origin/main...HEAD -- knowledge-base/marketing/brand-guide.md` for changes to positioning-related sections.
868
862
 
869
- **If triggered:**
870
-
871
- 1. Spawn the CMO agent (or soleur:marketing:conversion-optimizer for landing page specifics) with a website framing audit prompt. **Read the site source templates directly from the repo** (e.g., `apps/web-platform/`, `docs/`, or the Eleventy source directory) — do NOT use Playwright to fetch the rendered site when the source files are local. Prompt: "The brand guide's value proposition framings have been updated. Audit the website source templates for alignment: does the hero headline, subheadline, feature descriptions, and pricing page messaging match the updated framing recommendations? Identify specific copy that needs updating and propose replacements with file paths and line numbers."
872
- 2. Present the audit findings to the user.
873
- 3. **Interactive mode:** Ask "Apply website copy updates now, create issue for later, or skip?" Options: Apply now (edit site templates), Schedule (create GitHub issue with copy changes), Skip.
874
- 4. **Headless mode:** Auto-create a GitHub issue with the copy audit findings for later action.
863
+ **If triggered:** Spawn the CMO agent (or soleur:marketing:conversion-optimizer for landing-page specifics) with a website framing audit prompt. **Read the site source templates directly from the repo** (e.g., `apps/web-platform/`, `docs/`, or the Eleventy source directory) — do NOT use Playwright to fetch the rendered site when the source files are local. Prompt: "The brand guide's value proposition framings have been updated. Audit the website source templates for alignment: does the hero headline, subheadline, feature descriptions, and pricing page messaging match the updated framing recommendations? Identify specific copy that needs updating, propose replacements with file paths and line numbers, and return `DISPOSITION: apply-now | schedule | skip` plus a one-line rationale." **The CMO's disposition is the decision — do not ask the operator to choose.** Execute it: `apply-now` → apply the copy updates to the site templates and commit. `schedule` → file a GitHub issue with the copy-audit findings. `skip` → no issue. Emit `SOLEUR_RULE_APPLIED rule=cmo-website-framing-decision disposition=<d>` either way.
875
864
 
876
865
  **Why:** In #1173, the brand guide was updated with a new primary framing ("Stop hiring, start delegating"), a memory-first A/B variant, and trust scaffolding recommendations — but the website still used the old framing. Brand guide changes that don't cascade to the website create a disconnect between strategy and execution.
877
866