Skip to content

Commit a7242c7

Browse files
nreshoxyhelper[bot]
authored andcommitted
ci(skills-reconcile): trigger on repository_dispatch from skills (#2328)
* ci(skills-reconcile): trigger on repository_dispatch from skills Adds a `repository_dispatch: types: [skills-updated]` trigger so that oxy-hq/skills can announce a push as soon as it lands instead of waiting for the Monday 10:00 UTC scheduled scan to detect drift. Companion workflow lives in oxy-hq/skills: .github/workflows/notify-oxygen-internal.yaml. The schedule stays as a safety net (catches the case where the dispatch is missed -- token expiry, a push whose path filter we haven't extended yet on the skills side, etc.). The reconcile job's existing `if:` guard (`event_name != 'pull_request'`) admits repository_dispatch with no further changes; surfaces the triggering SHA in the job summary for traceability. * docs(knowledge): document the dispatch-driven reconcile trigger The reconcile job now fires on a `skills-updated` repository_dispatch from oxy-hq/skills as soon as a push lands; the Monday cron is a safety net. Update the drift-detection section so the docs match. GitOrigin-RevId: 77228e5d79bd99cc82fd0ef9341aee1409871910
1 parent 97e96bb commit a7242c7

2 files changed

Lines changed: 60 additions & 15 deletions

File tree

.github/workflows/skills-reconcile.yaml

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,37 @@ name: Skills reconcile
1515
# card or sync script in a way that breaks the source-of-truth
1616
# chain.
1717
#
18-
# - `reconcile` (schedule + workflow_dispatch): heavy weekly run.
19-
# Mints an Argo App token, checks out oxy-hq/skills, and drives
20-
# anthropics/claude-code-action@v1 through detect → re-condense →
21-
# bump SHA → re-vendor → verify → open-PR. Never auto-merges; the
22-
# cards are opinionated prose and review-by-default is the design.
18+
# - `reconcile` (repository_dispatch + schedule + workflow_dispatch):
19+
# heavy run that mints an Argo App token, checks out oxy-hq/skills,
20+
# and drives anthropics/claude-code-action@v1 through detect →
21+
# re-condense → bump SHA → re-vendor → verify → open-PR. Never
22+
# auto-merges; the cards are opinionated prose and review-by-default
23+
# is the design.
24+
#
25+
# Primary trigger is `repository_dispatch: skills-updated`, fired by
26+
# oxy-hq/skills/.github/workflows/notify-oxygen-internal.yaml as
27+
# soon as a push to skills@main touches a tracked file. Latency:
28+
# seconds, not days. The Monday cron stays as a safety net in case
29+
# the dispatch is missed.
2330
#
2431
# See:
2532
# - crates/agentic/builder/knowledge/README.md (drift + provenance)
2633
# - scripts/check-skills-drift.sh (the underlying check)
2734
# - scripts/sync-skills.sh (verbatim YAML vendoring)
35+
# - oxy-hq/skills/.github/workflows/notify-oxygen-internal.yaml
36+
# (the upstream dispatcher)
2837
# - .github/workflows/update-product-context.yaml (precedent)
2938

3039
on:
3140
schedule:
32-
- cron: "0 10 * * 1" # Mon 10:00 UTC
41+
- cron: "0 10 * * 1" # Mon 10:00 UTC (safety net for missed dispatches)
3342
workflow_dispatch:
43+
repository_dispatch:
44+
# Fired by oxy-hq/skills when a push to main touches a file the
45+
# knowledge module vendors. Payload carries the skills SHA, ref,
46+
# and compare URL for traceability; the reconcile job re-derives
47+
# the SHA from a fresh checkout so the payload is informational.
48+
types: [skills-updated]
3449
pull_request:
3550
paths:
3651
- "crates/agentic/builder/knowledge/**"
@@ -73,8 +88,9 @@ jobs:
7388
echo "All knowledge cards are reconciled against \`oxy-hq/skills@main\`."
7489
elif [ "$STATUS" -eq 1 ]; then
7590
echo
76-
echo "Drift detected. The weekly \`reconcile\` job will pick this up;"
77-
echo "see \`crates/agentic/builder/knowledge/README.md\` for the manual"
91+
echo "Drift detected. A \`skills-updated\` dispatch from oxy-hq/skills"
92+
echo "(or the Monday safety-net cron) will pick this up; see"
93+
echo "\`crates/agentic/builder/knowledge/README.md\` for the manual"
7894
echo "reconcile workflow if you want to resolve sooner."
7995
else
8096
echo
@@ -90,6 +106,26 @@ jobs:
90106
timeout-minutes: 20
91107

92108
steps:
109+
- name: Log trigger
110+
env:
111+
EVENT_NAME: ${{ github.event_name }}
112+
DISPATCH_SHA: ${{ github.event.client_payload.sha }}
113+
DISPATCH_REF: ${{ github.event.client_payload.ref }}
114+
DISPATCH_COMPARE: ${{ github.event.client_payload.compare_url }}
115+
run: |
116+
{
117+
echo "## Reconcile trigger"
118+
echo
119+
echo "- event: \`${EVENT_NAME}\`"
120+
if [ "${EVENT_NAME}" = "repository_dispatch" ]; then
121+
echo "- skills SHA: \`${DISPATCH_SHA}\`"
122+
echo "- skills ref: \`${DISPATCH_REF}\`"
123+
if [ -n "${DISPATCH_COMPARE}" ]; then
124+
echo "- compare: ${DISPATCH_COMPARE}"
125+
fi
126+
fi
127+
} >> "$GITHUB_STEP_SUMMARY"
128+
93129
- uses: actions/create-github-app-token@v3
94130
name: Create GitHub App Token
95131
id: app-token

crates/agentic/builder/knowledge/README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,22 @@ GH_TOKEN=$(gh auth token) bash scripts/check-skills-drift.sh
8686
The check also runs in CI via `.github/workflows/skills-reconcile.yaml`:
8787
- on PRs that touch this directory or the sync scripts (informational
8888
`check` job, doesn't block the PR), and
89-
- weekly on `main` (the `reconcile` job, which goes a step further than
90-
reporting and opens a PR with re-condensed cards for human review).
91-
92-
The reconcile loop is therefore: **drift CI flags →** re-condense the
93-
affected card from the listed sources → **bump `reconciled-at:`** to
94-
the new SHA → **re-run** `scripts/sync-skills.sh` so the templates and
95-
`Last synced:` line move together.
89+
- on `main` via the `reconcile` job, which goes a step further than
90+
reporting and opens a PR with re-condensed cards for human review.
91+
92+
The `reconcile` job is webhook-driven: a companion workflow in
93+
`oxy-hq/skills` (`.github/workflows/notify-oxygen-internal.yaml`) fires
94+
a `skills-updated` repository_dispatch on every push to `skills@main`
95+
that touches a tracked file, and oxygen-internal runs the reconcile
96+
flow within seconds. A weekly Monday cron stays as a safety net for
97+
missed dispatches (token expiry, a tracked path filter we forgot to
98+
extend upstream, etc.).
99+
100+
The reconcile loop is therefore: **upstream push →** dispatch → drift
101+
detected → re-condense the affected card from the listed sources →
102+
**bump `reconciled-at:`** to the new SHA → **re-run**
103+
`scripts/sync-skills.sh` so the templates and `Last synced:` line move
104+
together → open PR for human review.
96105

97106
## Why compile-time embedding
98107

0 commit comments

Comments
 (0)