Skip to content

Commit 3cf5f09

Browse files
committed
Initial release v0.1.0
- Core Weft CLI architecture - Agent-based workflow engine - Configuration system - OSS documentation
1 parent df417a3 commit 3cf5f09

525 files changed

Lines changed: 58757 additions & 26 deletions

File tree

Some content is hidden

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

‎.dockerignore‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Git
2+
.git/
3+
.gitignore
4+
5+
# Python
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
*.so
10+
.Python
11+
env/
12+
venv/
13+
ENV/
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
30+
# Testing
31+
.pytest_cache/
32+
.coverage
33+
htmlcov/
34+
.tox/
35+
36+
# IDEs
37+
.vscode/
38+
.idea/
39+
*.swp
40+
*.swo
41+
*~
42+
43+
# OS
44+
.DS_Store
45+
Thumbs.db
46+
47+
# Documentation builds
48+
docs/_build/
49+
50+
# Local development
51+
.env
52+
.env.local
53+
*.log
54+
data/
55+
56+
# Worktrees
57+
worktrees/
58+
59+
# Temporary files
60+
*.tmp
61+
tmp/
62+
temp/

‎.env.example‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# AI Workflow Configuration Template
2+
# Copy this file to .env and fill in your values
3+
4+
# Path to the code repository being developed
5+
CODE_REPO_PATH=
6+
7+
# Path to the AI history repository (stores all AI interactions)
8+
AI_HISTORY_PATH=
9+
10+
# Claude API key for AI backend (obtain from https://console.anthropic.com/)
11+
CLAUDE_API_KEY=
12+
13+
# Claude model to use for AI agents
14+
CLAUDE_MODEL=claude-3-5-sonnet-20241022
15+
16+
# Polling interval for watchers (in seconds)
17+
POLL_INTERVAL=2

‎.github/BRANCH_PROTECTION.md‎

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Branch Protection Setup
2+
3+
This document describes how to set up branch protection rules for the `main` branch to enforce CI checks and prevent direct commits.
4+
5+
## Required Steps
6+
7+
### 1. Enable Branch Protection
8+
9+
Go to: **Repository Settings → Branches → Add branch protection rule**
10+
11+
### 2. Configure Protection Rules
12+
13+
**Branch name pattern:** `main`
14+
15+
**Required Settings:**
16+
17+
- ✅ **Require a pull request before merging**
18+
- ✅ Require approvals: 1 (adjust based on team size)
19+
- ✅ Dismiss stale pull request approvals when new commits are pushed
20+
- ✅ Require review from Code Owners (optional, if using CODEOWNERS)
21+
22+
- ✅ **Require status checks to pass before merging**
23+
- ✅ Require branches to be up to date before merging
24+
- **Required status checks:**
25+
- `Lint`
26+
- `Test (Python 3.11)`
27+
- `Test (Python 3.12)`
28+
- `All checks passed`
29+
30+
- ✅ **Require conversation resolution before merging** (recommended)
31+
32+
- ✅ **Require linear history** (optional, enforces rebase/squash)
33+
34+
- ✅ **Do not allow bypassing the above settings** (recommended)
35+
36+
- ✅ **Restrict who can push to matching branches**
37+
- Only allow administrators (prevents direct commits to main)
38+
39+
### 3. Additional Recommended Settings
40+
41+
- ✅ **Allow force pushes:** Disabled
42+
- ✅ **Allow deletions:** Disabled
43+
44+
## Enforcement
45+
46+
Once enabled, all changes to `main` must:
47+
48+
1. Be submitted via pull request
49+
2. Pass all CI checks (lint + tests)
50+
3. Be reviewed and approved by at least 1 person
51+
4. Have all conversations resolved
52+
53+
Direct commits to `main` will be blocked, even for administrators.
54+
55+
## Emergency Override
56+
57+
Repository administrators can temporarily disable branch protection in extreme emergencies, but this should be:
58+
59+
1. Documented in an incident report
60+
2. Re-enabled immediately after the emergency
61+
3. Followed up with a post-mortem
62+
63+
## Verification
64+
65+
After setup, verify protection is working:
66+
67+
```bash
68+
# This should fail (cannot push to main directly)
69+
git checkout main
70+
echo "test" >> README.md
71+
git commit -am "test direct commit"
72+
git push origin main
73+
# Expected: ERROR - protected branch hook declined
74+
```
75+
76+
## CI Status Checks
77+
78+
The following jobs must pass:
79+
80+
1. **Lint** - Code formatting (black) and style (ruff)
81+
2. **Test (Python 3.11)** - Full test suite on Python 3.11
82+
3. **Test (Python 3.12)** - Full test suite on Python 3.12
83+
4. **All checks passed** - Aggregates all job results
84+
85+
Each PR will show these checks at the bottom with pass/fail status.
86+
87+
## Workflow for Contributors
88+
89+
1. Create feature branch: `git checkout -b feature/my-feature`
90+
2. Make changes and commit
91+
3. Push branch: `git push origin feature/my-feature`
92+
4. Open PR on GitHub
93+
5. Wait for CI checks to pass
94+
6. Request review
95+
7. Address feedback
96+
8. Merge after approval + passing checks
97+
98+
## Troubleshooting
99+
100+
**Q: CI checks not running?**
101+
- Ensure workflow file is in `.github/workflows/ci.yml`
102+
- Check Actions tab for errors
103+
- Verify branch is not filtered in workflow `on:` section
104+
105+
**Q: Status checks not appearing in branch protection?**
106+
- Status checks only appear after they've run at least once
107+
- Push a PR to trigger the workflow first
108+
- Then they'll be available in branch protection settings
109+
110+
**Q: Need to bypass for hotfix?**
111+
- Don't. Instead, create an emergency branch protection policy
112+
- Or temporarily add yourself to an exception list
113+
- Always re-enable protection immediately after
114+
115+
## Related Files
116+
117+
- `.github/workflows/ci.yml` - CI workflow definition
118+
- `pyproject.toml` - Tool configuration (black, ruff, pytest)
119+
- `CONTRIBUTING.md` - Contributor guidelines

‎.github/workflows/ci.yml‎

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
21+
- name: Cache pip packages
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.cache/pip
25+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
26+
restore-keys: |
27+
${{ runner.os }}-pip-
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -e ".[dev]"
33+
34+
- name: Check formatting with black
35+
run: black --check src/ tests/
36+
37+
- name: Lint with ruff
38+
run: ruff check src/ tests/
39+
40+
test:
41+
name: Test (Python ${{ matrix.python-version }})
42+
runs-on: ubuntu-latest
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
python-version: ["3.11", "3.12"]
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Set up Python ${{ matrix.python-version }}
52+
uses: actions/setup-python@v5
53+
with:
54+
python-version: ${{ matrix.python-version }}
55+
56+
- name: Cache pip packages
57+
uses: actions/cache@v3
58+
with:
59+
path: ~/.cache/pip
60+
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/pyproject.toml') }}
61+
restore-keys: |
62+
${{ runner.os }}-py${{ matrix.python-version }}-pip-
63+
64+
- name: Install dependencies
65+
run: |
66+
python -m pip install --upgrade pip
67+
pip install -e ".[dev]"
68+
69+
- name: Configure Git
70+
run: |
71+
git config --global user.name "CI Bot"
72+
git config --global user.email "ci@example.com"
73+
74+
- name: Run tests with pytest
75+
run: pytest --cov=weft --cov-report=xml --cov-report=term-missing
76+
77+
- name: Upload coverage to Codecov
78+
if: matrix.python-version == '3.11'
79+
uses: codecov/codecov-action@v3
80+
with:
81+
file: ./coverage.xml
82+
flags: unittests
83+
name: codecov-umbrella
84+
fail_ci_if_error: false
85+
86+
all-checks-passed:
87+
name: All checks passed
88+
runs-on: ubuntu-latest
89+
needs: [lint, test]
90+
if: always()
91+
steps:
92+
- name: Check all job status
93+
run: |
94+
if [ "${{ needs.lint.result }}" != "success" ]; then
95+
echo "Lint failed"
96+
exit 1
97+
fi
98+
if [ "${{ needs.test.result }}" != "success" ]; then
99+
echo "Tests failed"
100+
exit 1
101+
fi
102+
echo "All checks passed!"

‎.github/workflows/docs.yml‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'mkdocs.yml'
10+
- 'index.md'
11+
- '.github/workflows/docs.yml'
12+
- 'README.md'
13+
- 'CHANGELOG.md'
14+
- 'CONTRIBUTING.md'
15+
- 'LICENSE'
16+
- 'SECURITY.md'
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: write
21+
22+
jobs:
23+
deploy:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.11'
35+
36+
- name: Cache dependencies
37+
uses: actions/cache@v3
38+
with:
39+
key: ${{ github.ref }}
40+
path: .cache
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install -e ".[docs]"
46+
47+
- name: Configure Git
48+
run: |
49+
git config user.name "github-actions[bot]"
50+
git config user.email "github-actions[bot]@users.noreply.github.com"
51+
52+
- name: Build and deploy docs
53+
env:
54+
GOOGLE_ANALYTICS_KEY: ${{ vars.GOOGLE_ANALYTICS_KEY }}
55+
run: |
56+
mkdocs gh-deploy --force --clean --verbose
57+
58+
- name: Summary
59+
run: |
60+
echo "## Documentation Deployed! 📚" >> $GITHUB_STEP_SUMMARY
61+
echo "" >> $GITHUB_STEP_SUMMARY
62+
echo "The documentation has been successfully deployed to GitHub Pages." >> $GITHUB_STEP_SUMMARY
63+
echo "" >> $GITHUB_STEP_SUMMARY
64+
echo "### View Documentation" >> $GITHUB_STEP_SUMMARY
65+
echo "🔗 [https://weftlabs.github.io/weft-cli/](https://weftlabs.github.io/weft-cli/)" >> $GITHUB_STEP_SUMMARY
66+
echo "" >> $GITHUB_STEP_SUMMARY
67+
echo "### Updates" >> $GITHUB_STEP_SUMMARY
68+
echo "- Deployed from commit: \`${GITHUB_SHA:0:7}\`" >> $GITHUB_STEP_SUMMARY
69+
echo "- Branch: \`${GITHUB_REF_NAME}\`" >> $GITHUB_STEP_SUMMARY
70+
echo "- Triggered by: \`${GITHUB_ACTOR}\`" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)