Skip to content

Commit bbcdead

Browse files
author
cisco
committed
ci: refactor workflows, archive old specs, add releasing docs
- ci.yml: split into lint/build/test/security jobs with timeouts - data.yml: replace auto-commit to main with auto/data-sync PRs - release.yml: use go-version-file instead of hardcoded version - Remove distill.yml (duplicate of data.yml workflow_dispatch) - .goreleaser.yml: remove npm/darwin promises from release footer - Archive specs/ to project_context_main/ARCHIVE/old-specs/ - Archive CI_TARGET_ARCHITECTURE.md - Add docs/RELEASING.md with release process rules - Update SEMANTICS_CI_CD.md with 'Fixed' section - Add .gitignore entries for /mimic and bin/mimic.js
1 parent 478f794 commit bbcdead

43 files changed

Lines changed: 161 additions & 7626 deletions

Some content is hidden

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

‎.github/workflows/ci.yml‎

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,81 @@ name: CI
22

33
on:
44
push:
5-
branches: [dev, main]
5+
branches: [main, dev]
6+
paths-ignore:
7+
- '**/*.md'
8+
- 'docs/**'
9+
- 'project_context_main/**'
10+
- 'cookbook/**'
611
pull_request:
7-
branches: [dev, main]
12+
branches: [main, dev]
13+
paths-ignore:
14+
- '**/*.md'
15+
- 'docs/**'
16+
- 'project_context_main/**'
17+
- 'cookbook/**'
18+
19+
concurrency:
20+
group: ci-${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
825

926
jobs:
10-
check:
27+
lint:
1128
runs-on: ubuntu-latest
29+
timeout-minutes: 10
1230
steps:
1331
- uses: actions/checkout@v4
1432
- uses: actions/setup-go@v5
15-
env:
16-
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1733
with:
18-
go-version: '1.23'
34+
go-version-file: go.mod
35+
- name: gofmt
36+
run: gofmt -l . | grep -q . && exit 1 || true
37+
- name: go vet
38+
run: go vet ./...
1939

20-
- name: Install deps
21-
run: sudo apt-get update && sudo apt-get install -y gcc make
40+
build:
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 15
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-go@v5
46+
with:
47+
go-version-file: go.mod
48+
- name: Install build deps
49+
run: sudo apt-get update && sudo apt-get install -y gcc make libssl-dev
50+
- name: Build C-core
51+
run: make core/libcore.a
52+
- name: Build Go binary
53+
run: CGO_ENABLED=1 go build -trimpath -o bin/mimic ./cmd/mimic
2254

23-
- name: Build
24-
run: make build
55+
test:
56+
needs: [build]
57+
runs-on: ubuntu-latest
58+
timeout-minutes: 15
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/setup-go@v5
62+
with:
63+
go-version-file: go.mod
64+
- name: Install build deps
65+
run: sudo apt-get update && sudo apt-get install -y gcc make libssl-dev
66+
- name: Run tests
67+
run: make test
68+
- name: Run C-core tests
69+
run: make core-test
2570

26-
- name: Check
27-
run: make check
71+
security:
72+
runs-on: ubuntu-latest
73+
timeout-minutes: 10
74+
steps:
75+
- uses: actions/checkout@v4
76+
- uses: actions/setup-go@v5
77+
with:
78+
go-version-file: go.mod
79+
- name: Install govulncheck
80+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
81+
- name: Run govulncheck
82+
run: govulncheck ./...

‎.github/workflows/data.yml‎

Lines changed: 46 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
name: Data Pipeline
2-
# Slow, cron-triggered CI for sync repos, distill, and auto-ingestion.
3-
# Separated from code CI to avoid destructive overhead on every push.
4-
# Architecture: Data produces artifacts → Code CI consumes them.
52

63
on:
74
schedule:
8-
# Weekly at Sunday 02:00 UTC
95
- cron: '0 2 * * 0'
106
workflow_dispatch:
117
inputs:
@@ -18,26 +14,24 @@ on:
1814
type: boolean
1915
default: false
2016
skip_reach:
21-
description: 'Skip reach (Exa auto-ingestion) step'
17+
description: 'Skip reach step'
2218
type: boolean
2319
default: false
2420

2521
env:
26-
DATA_RELEASE_TAG: data-latest
2722
DISTILL_BATCH_SIZE: 10
28-
EXA_API_KEY: ${{ secrets.EXA_API_KEY }}
29-
MIMIC_AUTO_RESEARCH: true
3023
MIMIC_SEED_DIR: data/seeds
3124
MIMIC_AUTO_RESEARCH_MAX_RESULTS: 5
3225

26+
permissions:
27+
contents: read
28+
3329
jobs:
34-
# 1. Repository Sync
3530
sync-repos:
3631
runs-on: ubuntu-latest
3732
if: github.event.inputs.skip_sync != 'true'
3833
outputs:
3934
updated: ${{ steps.sync.outputs.updated }}
40-
new_sha: ${{ steps.sync.outputs.new_sha }}
4135
steps:
4236
- uses: actions/checkout@v4
4337
- name: Install Python deps
@@ -54,14 +48,14 @@ jobs:
5448
echo "updated=false" >> $GITHUB_OUTPUT
5549
else
5650
echo "updated=true" >> $GITHUB_OUTPUT
57-
git config user.name "Mimic Bot"
58-
git config user.email "bot@mayveskii.dev"
59-
git add mimicrya/repos-manifest.yaml
60-
git commit -m "data(sync): update repo SHAs $(date -u +%Y-%m-%d)"
61-
git push
6251
fi
52+
- name: Upload manifest
53+
if: steps.sync.outputs.updated == 'true'
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: manifest
57+
path: mimicrya/repos-manifest.yaml
6358

64-
# 2. Distillation
6559
distill:
6660
needs: sync-repos
6761
if: (needs.sync-repos.outputs.updated == 'true' || github.event.inputs.skip_sync == 'true') && github.event.inputs.skip_distill != 'true'
@@ -83,76 +77,68 @@ jobs:
8377
--slots data/distilled/mesh_slots.json \
8478
--min-precision 0.8 \
8579
--qac all
86-
- name: Package data
87-
run: |
88-
bash scripts/package-data.sh ${{ env.DATA_RELEASE_TAG }}
89-
- name: Upload data artifact
80+
- name: Upload distilled data
9081
uses: actions/upload-artifact@v4
9182
with:
92-
name: mesh-data
93-
path: dist/mimic-data-*.tar.gz
83+
name: distilled
84+
path: data/distilled/
9485

95-
# 3. Reach — Auto-ingestion via Exa for repos with 0 slots
9686
reach:
9787
needs: sync-repos
9888
if: github.event.inputs.skip_reach != 'true'
9989
runs-on: ubuntu-latest
10090
steps:
10191
- uses: actions/checkout@v4
10292
- name: Install Python deps
103-
run: |
104-
pip install requests
105-
- name: Run reach (auto-ingestion for pending repos)
93+
run: pip install requests
94+
- name: Run reach
10695
run: |
10796
python3 scripts/reach.py \
10897
--manifest mimicrya/repos-manifest.yaml \
10998
--seeds ${{ env.MIMIC_SEED_DIR }} \
11099
--max-results ${{ env.MIMIC_AUTO_RESEARCH_MAX_RESULTS }}
111100
env:
112101
EXA_API_KEY: ${{ secrets.EXA_API_KEY }}
113-
- name: Commit new seeds
114-
run: |
115-
if [ -n "$(git status --porcelain ${{ env.MIMIC_SEED_DIR }})" ]; then
116-
git config user.name "Mimic Bot"
117-
git config user.email "bot@mayveskii.dev"
118-
git add ${{ env.MIMIC_SEED_DIR }}
119-
git commit -m "data(reach): auto-ingestion seeds $(date -u +%Y-%m-%d)"
120-
git push
121-
fi
102+
- name: Upload seeds
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: seeds
106+
path: ${{ env.MIMIC_SEED_DIR }}/
122107

123-
# 4. Publish Data Release (GitHub Release with data bundle)
124-
publish-data-release:
108+
create-pr:
125109
needs: [distill, reach]
110+
if: always() && (needs.distill.result == 'success' || needs.reach.result == 'success')
126111
runs-on: ubuntu-latest
127112
permissions:
128113
contents: write
114+
pull-requests: write
129115
steps:
130116
- uses: actions/checkout@v4
131-
- name: Download data artifact
117+
- name: Download artifacts
132118
uses: actions/download-artifact@v4
133119
with:
134-
name: mesh-data
135120
path: artifacts/
136-
- name: Update data-latest release
137-
uses: softprops/action-gh-release@v2
138-
with:
139-
tag_name: ${{ env.DATA_RELEASE_TAG }}
140-
files: artifacts/*
141-
name: "Mimic Data Bundle (latest)"
142-
body: |
143-
## Automated Data Pipeline Output
144-
- **Generated:** $(date -u)
145-
- **Repos synced:** from repos-manifest.yaml
146-
- **Slots distilled:** see mesh_slots.json inside
147-
- **Seeds reached:** from Exa auto-ingestion
148-
149-
To use:
150-
```bash
151-
./install.sh --data-only
152-
# or
153-
docker run -e MIMIC_CACHE_ENABLED=true mayveskii/mimic:latest serve
154-
```
155-
draft: false
156-
prerelease: false
121+
merge-multiple: true
122+
- name: Apply changes
123+
run: |
124+
mkdir -p data/distilled data/seeds
125+
cp -r artifacts/distilled/* data/distilled/ 2>/dev/null || true
126+
cp -r artifacts/seeds/* data/seeds/ 2>/dev/null || true
127+
cp artifacts/repos-manifest.yaml mimicrya/repos-manifest.yaml 2>/dev/null || true
128+
- name: Create Pull Request
129+
run: |
130+
git config user.name "Mimic Bot"
131+
git config user.email "bot@mayveskii.dev"
132+
BRANCH="auto/data-sync-$(date -u +%Y%m%d-%H%M%S)"
133+
git checkout -b "$BRANCH"
134+
git add -A
135+
git commit -m "data: automated sync & distillation $(date -u +%Y-%m-%d)" || exit 0
136+
git push origin "$BRANCH"
137+
gh pr create \
138+
--base dev \
139+
--head "$BRANCH" \
140+
--title "data: automated sync & distillation" \
141+
--body "Automated data pipeline run. Review before merge." \
142+
--draft=false
157143
env:
158144
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/distill.yml‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ permissions:
1212
jobs:
1313
release:
1414
runs-on: ubuntu-latest
15+
timeout-minutes: 30
1516
steps:
1617
- uses: actions/checkout@v4
1718
with:
1819
fetch-depth: 0
1920

2021
- uses: actions/setup-go@v5
2122
with:
22-
go-version: '1.23'
23+
go-version-file: go.mod
2324

2425
- name: Install build deps
2526
run: sudo apt-get update && sudo apt-get install -y gcc make libssl-dev

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,5 @@ libnano_ops.so
6767
data/mesh/graphs/
6868

6969
# Verification tool (should be tracked, not ignored)
70+
/mimic
71+
bin/mimic.js

‎.goreleaser.yml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ release:
8383
```bash
8484
docker run -p 1337:1337 ghcr.io/mayveskii/mimic:{{ .Tag }}
8585
```
86-
87-
## npm
88-
```bash
89-
npx @mayveskii/mimic serve
90-
```
9186
extra_files:
9287
- glob: ./README.md
9388
- glob: ./AGENTS.md

‎docs/RELEASING.md‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Releasing Mimic
2+
3+
## Branches
4+
5+
- `main` — стабильная ветка. Только через PR.
6+
- `dev` — интеграция. Фича-ветки мёрджатся сюда.
7+
8+
## Pull Requests
9+
10+
1. Каждый PR требует зелёный CI (`lint`, `build`, `test`, `security`)
11+
2. PR в `main` требует review
12+
3. Не мёрджить если хоть один job красный
13+
14+
## Versioning
15+
16+
- Semantic versioning: `vMAJOR.MINOR.PATCH`
17+
- Тег создаётся вручную после мёрджа в `main`
18+
- Тег нельзя пересоздавать. Ошибка → новый тег
19+
20+
## Release Process
21+
22+
1. Убедиться что `main` зелёный
23+
2. Создать annotated tag:
24+
```bash
25+
git tag -a v0.x.x -m "Release v0.x.x"
26+
git push origin v0.x.x
27+
```
28+
3. GoReleaser автоматически:
29+
- Соберёт `linux/amd64` бинарник
30+
- Создаст GitHub Release
31+
- Опубликует Docker образ в GHCR
32+
33+
## Data Pipeline
34+
35+
- Раз в неделю (или вручную) — workflow `data.yml`
36+
- Создаёт ветку `auto/data-sync-YYYYMMDD`
37+
- Открывает PR в `dev`
38+
- Ты решаешь: merge или close
39+
- Никаких автокоммитов в `main`
40+
41+
## npm
42+
43+
- Не используется в текущих релизах
44+
- Будет добавлено когда Mimic готов к широкому выпуску

0 commit comments

Comments
 (0)