Skip to content

Commit 174d704

Browse files
mcp-tool-shopclaude
andcommitted
chore(swarm): Stage B/C/D — proactive health, humanization, polish
Dogfood swarm Stage B audit (proactive lens) found 71 future-proofing, observability, and defensive-coding gaps. Stage C/D amend addresses them across all 5 owned domains. Scripts UX (marketing/scripts/): - --root <path> + MCPT_MARKETING_ROOT env (alternate marketing trees) - --help, --version on all 3 scripts - --json, --quiet, --verbose modes on validate.mjs - atomic lockfile write (tmp + crypto.randomUUID + fs.rename) - schemaVersion preflight check (I15) on every loaded document - --max-evidence-bytes <N> guard (default 100 MiB) - path-traversal errors split into specific named branches - loadJson moved into _paths.mjs (single I/O surface) - explicit "Evidence manifest: N entries" line + warn when proven claims exist with empty manifest Schema future-proofing (marketing/schema/): - aliases[] on every IDed entity (downstream rename resolution) - field-level deprecation pattern (JSON Schema 2019-09 deprecated: true) - lastModified + contentHash optional shape fields - x-* extension carve-out (forward-compat experimentation) - messageChannel + pressContactMethod oneOf [closed-enum, x-pattern] - $defs/graduation block for aspirational claims - examples[] on 9 high-leverage types - defaults on 3 enums - top-level schemaVersion: "1" + version-aware $id (/schema/v1/...) - projectForbiddenPhrases + projectPreferredNouns hooks on index - aliases ["claim.zip-meta-map.246-tests"] on test-suite (concrete proof) - graduation blocks on all 6 zip-meta-map aspirational claims with blockedBy + targetDate Test coverage (test/): - 46 → 73 tests (+27) - I12-extended scope negative test (audience+campaign forbidden phrases) - gen-lock --check missing-lockfile and malformed-lockfile branches - validate error envelopes: malformed JSON, manifest shape, traversal - _paths leading-dot rejection tests - schema-vs-runtime consistency invariant suite (pins drift) - test/helpers/temp-tree.mjs extracted (no more inline tree builders) - test:gen-lock, test:validate, test:hash-file, test:_paths, test:version, test:watch, test:coverage scripts CI release flow (.github/): - workflows/release.yml — tag-driven, validates tag↔package.json, CHANGELOG section gate, gh release create --generate-notes - workflows/scorecard.yml — OSSF Scorecard, SHA-pinned, weekly - $GITHUB_STEP_SUMMARY lines per gate - npm ci retry on transient failures - Node 20 back in matrix (auto-discovery script form works on 20+) - CodeQL dropped PR trigger (over-eager for 300 LoC) - PULL_REQUEST_TEMPLATE.md (Summary / Falsifiability / Test plan) - ISSUE_TEMPLATE/bug.yml + feature.yml + config.yml - .gitignore expanded (*.log, *.tgz, competing lockfiles, build caches) Doc completeness (root): - CONTRIBUTING.md (150 lines) — quick start, dev loop, adding tools/claims, schema changes, forbidden phrases, honesty principles - RELEASING.md (134 lines) — pre-release checks, version-bump rules, 7-step release sequence, hot-fix process - ARCHITECTURE.md (155 lines) — why MarketIR, core invariants, data flow, components, design rationale, extension points - ROADMAP.md (74 lines) — currently shipped, pre-launch deps, v1.1 plans - README de-duped (audit-date → SCORECARD, test-count → Testing section, data-scope → SECURITY) - README adds Consumer contract, Versioning policy, Troubleshooting, Scripts reference 5 owned domains, exclusive file ownership enforced. Final state: validate ✓ lock:check ✓ 73/73 tests ✓ fmt:check ✓ Schema 19,350 → 35,129 bytes (more strict, more flexible at extension points). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e8f2612 commit 174d704

28 files changed

Lines changed: 2718 additions & 185 deletions

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Bug report
2+
description: A script, schema, or claim is producing the wrong result.
3+
title: "[bug] "
4+
labels:
5+
- bug
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Thanks for taking the time to file a clear bug. The repo's thesis is that
11+
claims are falsifiable — bug reports are most useful when they include
12+
the exact command, the actual output, and what you expected instead.
13+
14+
- type: input
15+
id: version
16+
attributes:
17+
label: Version
18+
description: Tag or commit SHA you're on (e.g., `v1.0.0`, `abcdef0`).
19+
placeholder: v1.0.0
20+
validations:
21+
required: true
22+
23+
- type: dropdown
24+
id: os
25+
attributes:
26+
label: Operating system
27+
options:
28+
- Linux
29+
- macOS
30+
- Windows
31+
- Other (describe in steps)
32+
validations:
33+
required: true
34+
35+
- type: input
36+
id: node
37+
attributes:
38+
label: Node version
39+
description: Output of `node --version`. The repo supports Node 20+.
40+
placeholder: v22.10.0
41+
validations:
42+
required: true
43+
44+
- type: textarea
45+
id: steps
46+
attributes:
47+
label: Steps to reproduce
48+
description: Exact commands. Paste output as-is — do not summarize.
49+
placeholder: |
50+
1. `git clone https://github.com/mcp-tool-shop/mcpt-marketing`
51+
2. `cd mcpt-marketing && npm ci`
52+
3. `npm run validate`
53+
4. ...
54+
validations:
55+
required: true
56+
57+
- type: textarea
58+
id: expected
59+
attributes:
60+
label: Expected result
61+
validations:
62+
required: true
63+
64+
- type: textarea
65+
id: actual
66+
attributes:
67+
label: Actual result
68+
description: Include the full error message and any stack trace.
69+
validations:
70+
required: true
71+
72+
- type: textarea
73+
id: extra
74+
attributes:
75+
label: Anything else?
76+
description: Logs, screenshots, related issues. Optional.
77+
validations:
78+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Question or discussion
4+
url: https://github.com/mcp-tool-shop/mcpt-marketing/discussions
5+
about: |
6+
Open-ended questions ("how would I…", "should this…", "what about…")
7+
belong in Discussions. The issue tracker is for bugs and concrete
8+
feature requests.
9+
- name: Security report
10+
url: https://github.com/mcp-tool-shop/mcpt-marketing/security/advisories/new
11+
about: |
12+
Report a security vulnerability privately via GitHub Security
13+
Advisories. Do not open a public issue for security reports.

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Feature request
2+
description: Propose a new claim, schema field, script, or workflow capability.
3+
title: "[feature] "
4+
labels:
5+
- enhancement
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Feature requests are most useful when they describe the problem before
11+
the solution. If you're proposing a new claim or schema field, include
12+
what evidence would back it and what would falsify it.
13+
14+
- type: textarea
15+
id: problem
16+
attributes:
17+
label: Problem
18+
description: What is hard, missing, or wrong today? Be concrete.
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: proposal
24+
attributes:
25+
label: Proposed solution
26+
description: |
27+
What would change. If it's a script or schema change, sketch the shape
28+
(sample input, sample output, error message). If it's a new claim,
29+
describe the evidence it would cite.
30+
validations:
31+
required: true
32+
33+
- type: textarea
34+
id: alternatives
35+
attributes:
36+
label: Alternatives considered
37+
description: What else did you think about, and why is the proposal better?
38+
validations:
39+
required: false
40+
41+
- type: textarea
42+
id: scope
43+
attributes:
44+
label: Scope and falsifiability
45+
description: |
46+
- Does this add a claim? If so, what observation would prove it false?
47+
- Does this change a contract? If so, what currently-passing case
48+
would break?
49+
placeholder: |
50+
- New claim: yes / no
51+
- Falsified by: ...
52+
- Breaking: yes / no
53+
validations:
54+
required: false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!--
2+
This repo's thesis is that marketing claims should be falsifiable and evidence
3+
should be hash-verified. PRs are the human entry point to that pipeline, so
4+
they get the same shape: state the change, state how it could be wrong, state
5+
how to confirm it isn't.
6+
7+
Delete sections that don't apply. Keep the headers you fill in.
8+
-->
9+
10+
## Summary
11+
12+
<!-- 1–3 sentences: what this PR changes and why. -->
13+
14+
## Falsifiability check
15+
16+
<!--
17+
The repo's thesis is falsifiable claims. Every PR should answer at least one of:
18+
19+
- If a claim was added or changed: what evidence (URL + content hash) backs it,
20+
and what observation would falsify it?
21+
- If a script or schema was changed: what input would have produced the wrong
22+
answer before, and produces the right answer now?
23+
- If only docs / CI / chore: write "n/a — no claim or behavior change" and
24+
explain briefly why.
25+
-->
26+
27+
## Test plan
28+
29+
<!--
30+
- [ ] `npm run fmt:check` passes
31+
- [ ] `npm run validate` passes
32+
- [ ] `npm test` passes (all suites)
33+
- [ ] `npm run lock:check` passes
34+
- [ ] CHANGELOG.md updated under `[Unreleased]` (or marked n/a)
35+
- [ ] Any new claim has hash-verified evidence (or marked aspirational)
36+
-->
37+
38+
## Linked issues
39+
40+
<!-- e.g., Closes #123, Refs #456. Delete if none. -->

.github/workflows/ci.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
fail-fast: false
4343
matrix:
4444
os: [ubuntu-latest, windows-latest]
45-
node-version: ["22"]
45+
node-version: ["20", "22"]
4646
steps:
4747
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
4848

@@ -52,16 +52,42 @@ jobs:
5252
cache: npm
5353

5454
- name: Install dependencies
55-
run: npm ci
55+
shell: bash
56+
run: npm ci || (sleep 10 && npm ci)
5657

5758
- name: Format check
58-
run: npm run fmt:check
59+
shell: bash
60+
run: |
61+
npm run fmt:check
62+
echo "- Format check: passed (\`prettier --check .\`)" >> "$GITHUB_STEP_SUMMARY"
5963
6064
- name: Schema + invariant validation
61-
run: npm run validate
65+
shell: bash
66+
run: |
67+
npm run validate
68+
echo "- Schema + invariant validation: passed (\`marketing/scripts/validate.mjs\`)" >> "$GITHUB_STEP_SUMMARY"
6269
6370
- name: Tests
64-
run: npm test
71+
shell: bash
72+
run: |
73+
npm test
74+
echo "- Tests: passed (\`node --test\`)" >> "$GITHUB_STEP_SUMMARY"
6575
6676
- name: Lockfile drift check
67-
run: npm run lock:check
77+
shell: bash
78+
run: |
79+
npm run lock:check
80+
echo "- Lockfile drift check: passed (\`gen-lock.mjs --check\`)" >> "$GITHUB_STEP_SUMMARY"
81+
82+
- name: Job summary header
83+
if: always()
84+
shell: bash
85+
run: |
86+
{
87+
echo ""
88+
echo "### CI matrix cell"
89+
echo ""
90+
echo "- OS: \`${{ matrix.os }}\`"
91+
echo "- Node: \`${{ matrix.node-version }}\`"
92+
echo "- Status: \`${{ job.status }}\`"
93+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/codeql.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ name: CodeQL
33
on:
44
push:
55
branches: [main]
6-
pull_request:
7-
branches: [main]
86
schedule:
97
- cron: "0 6 * * 1"
8+
workflow_dispatch:
109

1110
concurrency:
1211
group: ${{ github.workflow }}-${{ github.ref }}
13-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12+
cancel-in-progress: false
1413

1514
permissions:
1615
contents: read

0 commit comments

Comments
 (0)