Skip to content

Commit 0439277

Browse files
committed
feat: more updates to the canary implementation
1 parent d0b4e23 commit 0439277

File tree

16 files changed

+239
-19
lines changed

16 files changed

+239
-19
lines changed

.github/compass.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: canary
2+
id: 'ari:cloud:compass:89436501-45fd-498f-9c7c-b0db10b968cb:component/d819e7ce-7ec1-48ae-b718-cb3459fc6e06/41e70807-ff9f-4225-8e75-83c73d405ad6'
3+
slug: canary
4+
description: 'Creator, Manager and Manager of Agent Prompts and Canary Tokens in Agent Repositories'
5+
configVersion: 1
6+
typeId: APPLICATION
7+
ownerId: 'ari:cloud:identity::team/94046dbf-b5f2-435e-bd32-3aee54446e1f'
8+
fields:
9+
lifecycle: Pre-release
10+
tier: 4
11+
isMonorepoProject: false
12+
links:
13+
- name: null
14+
type: REPOSITORY
15+
url: 'https://github.com/codeprosorg/canary'
16+
- name: ''
17+
type: PROJECT
18+
url: 'https://devnw.atlassian.net/browse/CP'
19+
relationships: {}
20+
labels:
21+
- 'source:github'
22+
- synced-with-jsm
23+
customFields: null
24+
25+
# Learn more about formatting compass.yml:
26+
# https://go.atlassian.com/compass-yml-format

.github/pcapcompare-profiles/tcpdump-default.json

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

.github/pcapcompare-profiles/tshark-default.json

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

.github/workflows/canary.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
name: canary
22
on: [push, pull_request]
3+
jobs:
4+
scan:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: actions/setup-go@v5
9+
with: { go-version: '1.25' }
10+
- name: Build scanner
11+
run: go build -o ./bin/canary ./tools/canary
12+
- name: Generate status
13+
run: ./bin/canary --root . --out status.json --csv status.csv
14+
- name: Self-verify
15+
run: ./bin/canary --root tools/canary --verify GAP_ANALYSIS.md --strict
16+
- name: Upload artifacts
17+
uses: actions/upload-artifact@v4
18+
with:
19+
name: canary-status
20+
path: |
21+
status.json
22+
status.csv
23+
name: canary
24+
on: [push, pull_request]
325
jobs:
426
scan:
527
runs-on: ubuntu-latest

GAP_ANALYSIS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Requirements Gap Analysis (Self)
2+
3+
✅ CBIN-101
4+
✅ CBIN-102

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ release:
152152
git tag -a ${tag} -m "${tag}"
153153
git push origin ${tag}
154154

155+
# Canary targets
156+
canary:
157+
go build -o ./bin/canary ./tools/canary && ./bin/canary --root . --out status.json --csv status.csv
158+
159+
canary-verify:
160+
./bin/canary --root . --verify GAP_ANALYSIS.md --strict
161+
162+
acceptance:
163+
go test ./tools/canary/... -run TestAcceptance -v
164+
155165
clean:
156166
rm -rf dist
157167
rm -rf out

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,12 @@ Example: if a feature is marked `STATUS=IMPL` and has a `TEST=TestCANARY_REQ_GQL
5151
cd tools/canary
5252
go test -v
5353
```
54+
55+
## CANARY at a glance
56+
57+
Policy excerpt (see `docs/CANARY_POLICY.md`). Example tokens:
58+
59+
`CANARY: REQ=CBIN-101; FEATURE="ScannerCore"; ASPECT=Engine; STATUS=TESTED; TEST=TestCANARY_CBIN_101_Engine_ScanBasic; BENCH=BenchmarkCANARY_CBIN_101_Engine_Scan; OWNER=canary; UPDATED=2025-09-20`
60+
61+
`CANARY: REQ=CBIN-102; FEATURE="VerifyGate"; ASPECT=CLI; STATUS=TESTED; TEST=TestCANARY_CBIN_102_CLI_Verify; BENCH=BenchmarkCANARY_CBIN_102_CLI_Verify; OWNER=canary; UPDATED=2025-09-20`
62+

docs/CANARY_POLICY.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# CANARY Policy (Repo‑Wide)
2+
3+
**Purpose.** Make every feature claim searchable and verifiable by linking requirements → code → tests → docs.
4+
5+
## Token (single line, place at top of implementation files or relevant tests)
6+
`CANARY: REQ=CBIN-<###>; FEATURE="<name>"; ASPECT=<ASPECT>; STATUS=<STATUS>; TEST=<TestCANARY_CBIN_<###>_<Aspect>_<Short>>; BENCH=<BenchmarkCANARY_CBIN_<###>_<Aspect>_<Short>>; OWNER=<team-or-alias>; UPDATED=<YYYY-MM-DD>`
7+
8+
- **ASPECT**["API","CLI","Engine","Planner","Storage","Wire","Security","Docs","Decode","Encode","RoundTrip","Bench","FrontEnd","Dist"]
9+
- **STATUS**["MISSING","STUB","IMPL","TESTED","BENCHED","REMOVED"]
10+
11+
### Greps
12+
13+
- `rg -n "CANARY:\s*REQ=CBIN-" src internal cmd tools`
14+
- `rg -n "TestCANARY_CBIN_" src internal cmd tools tests`
15+
- `rg -n "BenchmarkCANARY_CBIN_" src internal cmd tools tests`

internal/gen/prompts/prompts.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package prompts
2+
3+
// (deprecated placeholder intentionally left empty to avoid duplicate embeddings)

prompts/prompts.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package prompts
2+
3+
import _ "embed"
4+
5+
//go:embed sys/init.md
6+
var Init string
7+
//go:embed sys/policy.md
8+
var Policy string
9+
//go:embed sys/requirements.md
10+
var Requirements string
11+
//go:embed sys/evaluate.md
12+
var Evaluate string
13+
14+
func All() map[string]string { return map[string]string{"init": Init, "policy": Policy, "requirements": Requirements, "evaluate": Evaluate} }

0 commit comments

Comments
 (0)