Skip to content

Commit 2cdcb8a

Browse files
committed
Harden loop patterns and OSS maintenance
1 parent 25b9fea commit 2cdcb8a

41 files changed

Lines changed: 2317 additions & 200 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 2
9+
trim_trailing_whitespace = true
10+
11+
[*.py]
12+
indent_size = 4
13+
14+
[Makefile]
15+
indent_style = tab

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @MPIsaac-Per

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Bug report
2+
description: Report reproducible incorrect behavior in a sample or tool.
3+
title: "bug: "
4+
labels: [bug, triage]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: Do not include API keys, credentials, private transcripts, or customer data.
9+
- type: input
10+
id: pattern
11+
attributes:
12+
label: Pattern or file
13+
placeholder: 03-verification-gate/verify.py
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: reproduction
18+
attributes:
19+
label: Reproduction
20+
description: Include the smallest command, configuration, and input needed to reproduce the problem.
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: expected
25+
attributes:
26+
label: Expected behavior
27+
validations:
28+
required: true
29+
- type: textarea
30+
id: actual
31+
attributes:
32+
label: Actual behavior
33+
validations:
34+
required: true
35+
- type: input
36+
id: environment
37+
attributes:
38+
label: Environment
39+
placeholder: macOS 15, Python 3.13, Claude Code 2.x
40+
validations:
41+
required: true
42+
- type: checkboxes
43+
id: checks
44+
attributes:
45+
label: Pre-submission checks
46+
options:
47+
- label: I removed secrets and private data from this report.
48+
required: true
49+
- label: I searched existing issues for the same behavior.
50+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security vulnerability
4+
url: https://github.com/MPIsaac-Per/claude-code-loop-patterns/security/advisories/new
5+
about: Report vulnerabilities privately. Do not open a public issue.
6+
- name: Usage questions
7+
url: https://github.com/MPIsaac-Per/claude-code-loop-patterns/discussions
8+
about: Ask implementation and integration questions in Discussions.

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Pattern proposal
2+
description: Propose a bounded addition or improvement to the collection.
3+
title: "proposal: "
4+
labels: [enhancement, triage]
5+
body:
6+
- type: textarea
7+
id: problem
8+
attributes:
9+
label: Failure mode
10+
description: Describe the loop failure or maintenance problem this pattern should address.
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: proposal
15+
attributes:
16+
label: Proposed pattern
17+
description: Explain the behavior, interface, and evidence that would validate it.
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: alternatives
22+
attributes:
23+
label: Existing tools or prior art
24+
description: Link established implementations that contributors should evaluate first.
25+
validations:
26+
required: true

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
github-actions:
9+
patterns: ["*"]
10+
labels: [dependencies]
11+
open-pull-requests-limit: 5
12+
13+
- package-ecosystem: pip
14+
directory: /
15+
schedule:
16+
interval: weekly
17+
groups:
18+
development-dependencies:
19+
dependency-type: development
20+
labels: [dependencies, python]
21+
open-pull-requests-limit: 5

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Change
2+
3+
Describe the behavior or documentation changed.
4+
5+
## Verification
6+
7+
- [ ] `uv run ruff check .`
8+
- [ ] `uv run ruff format --check .`
9+
- [ ] `uv run pytest --cov=. --cov-report=term-missing`
10+
- [ ] Documentation and examples match the implemented behavior
11+
12+
## Risk
13+
14+
List compatibility, security, or rollout concerns. Write `None` when there are none.

.github/workflows/ci.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
quality:
18+
name: Quality
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
steps:
22+
- name: Check out repository
23+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
24+
with:
25+
persist-credentials: false
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
28+
with:
29+
enable-cache: true
30+
- name: Set up Python
31+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
32+
with:
33+
python-version: "3.14"
34+
- name: Install locked dependencies
35+
run: uv sync --locked --dev
36+
- name: Lint
37+
run: uv run ruff check .
38+
- name: Check formatting
39+
run: uv run ruff format --check .
40+
- name: Type-check runtime files
41+
run: >-
42+
uv run mypy
43+
01-structured-shell/run_loud.py
44+
02-structured-tests/pytest_jsonl_reporter.py
45+
03-verification-gate/check_evidence.py
46+
03-verification-gate/verify.py
47+
04-stop-hook/no_completion_without_evidence.py
48+
05-prompt-cache/cacheable_prompt.py
49+
- name: Audit Python dependencies
50+
run: uv run pip-audit
51+
52+
test:
53+
name: Test (Python ${{ matrix.python-version }})
54+
runs-on: ubuntu-latest
55+
timeout-minutes: 10
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
python-version: ["3.11", "3.14"]
60+
steps:
61+
- name: Check out repository
62+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
63+
with:
64+
persist-credentials: false
65+
- name: Install uv
66+
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
67+
with:
68+
enable-cache: true
69+
- name: Set up Python
70+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
71+
with:
72+
python-version: ${{ matrix.python-version }}
73+
- name: Install locked dependencies
74+
run: uv sync --locked --dev
75+
- name: Test
76+
run: uv run pytest --cov=. --cov-report=term-missing --cov-report=xml
77+
- name: Upload coverage report
78+
if: matrix.python-version == '3.14'
79+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
80+
with:
81+
name: coverage-report
82+
path: coverage.xml
83+
if-no-files-found: error
84+
retention-days: 14

.github/workflows/codeql.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "17 6 * * 1"
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: codeql-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
analyze:
21+
name: Analyze Python
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 15
24+
permissions:
25+
contents: read
26+
security-events: write # Upload CodeQL findings to code scanning.
27+
steps:
28+
- name: Check out repository
29+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
30+
with:
31+
persist-credentials: false
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
34+
with:
35+
languages: python
36+
queries: security-extended
37+
- name: Analyze
38+
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Dependency review
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
concurrency:
10+
group: dependency-review-${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
review:
15+
name: Review dependencies
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
steps:
19+
- name: Check out repository
20+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
21+
with:
22+
persist-credentials: false
23+
- name: Review dependency changes
24+
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0

0 commit comments

Comments
 (0)