Skip to content

Commit 29eb56b

Browse files
authored
리포 위생: README 수치 자동 동기화 · 라이선스 · 신원 통일 (#9)
* feat(readme): 숫자 표 자동 동기화 — 배포마다 data 실측으로 재생성 - scripts/sync-readme.mjs: 추적 레코드/열림/정책 명시/피드/골든/슬롭린트 수를 data/*.json + collectFeedItems + slop-lint 출력에서 계산해 README 표를 다시 쓴다(멱등) - deploy.yml: sync-readme 잡 신설. 바뀌면 github-actions[bot] 이 커밋 (GITHUB_TOKEN 푸시는 deploy 재트리거 없음). paths 에 scripts/** 추가 - 2026-11-12 스냅샷(192건)을 11-16 실측(206건 · 열림 104 · 피드 104)으로 갱신 * docs: 라이선스 명시 + 커밋 신원 통일 - LICENSE(MIT): 코드. 데이터(data/*.json·guides)는 CC BY 4.0, README 규정 추가 - .mailmap: 같은 사람의 신원 3종(정인권×2 + developjik noreply)을 하나로 * review: 골든케이스 실측 통과 수 반영 + golden_cases.json 트리거 추가 (PR #9 Codex 리뷰) - sync-readme: 설정 개수(6/6 고정)가 아니라 validate.mjs 실행 결과의 X/Y를 표에 쓴다. validate 실패 시 sync-readme도 exit 1 — 깨진 데이터로 README 갱신 금지 - deploy.yml paths에 collector/golden_cases.json 추가 (케이스 증감 시 README 동기화)
1 parent df169ec commit 29eb56b

5 files changed

Lines changed: 164 additions & 7 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: deploy
22
on:
33
push:
44
branches: [main]
5-
paths: ['web/**', 'data/**', '.github/workflows/deploy.yml']
5+
paths: ['web/**', 'data/**', 'scripts/**', 'collector/golden_cases.json', '.github/workflows/deploy.yml']
66
workflow_dispatch:
77

88
permissions:
@@ -15,6 +15,35 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18+
sync-readme:
19+
# README '숫자' 표를 data/*.json 실측으로 다시 쓴다(정의: scripts/sync-readme.mjs).
20+
# 바뀌면 봇이 커밋한다. GITHUB_TOKEN 푸시는 deploy 를 다시 트리거하지 않아 무한루프가 없다.
21+
permissions:
22+
contents: write
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
ref: main
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
- name: README 수치 동기화
32+
run: node scripts/sync-readme.mjs
33+
- name: 바뀐 게 있으면 커밋·푸시
34+
run: |
35+
set -eu
36+
if git diff --quiet -- README.md; then
37+
echo "변경 없음 — 커밋하지 않는다"
38+
exit 0
39+
fi
40+
git config user.name "github-actions[bot]"
41+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
42+
git add README.md
43+
git commit -m "chore(readme): sync numbers from data"
44+
git pull --rebase --autostash origin main
45+
git push origin HEAD:main
46+
1847
build:
1948
runs-on: ubuntu-latest
2049
steps:

‎.mailmap‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 같은 사람의 커밋 신원 3종을 하나로 (git shortlog/insights 왜곡 방지)
2+
정인권 <developjik@gmail.com> developjik <67889389+developjik@users.noreply.github.com>
3+
정인권 <developjik@gmail.com> 정인권 <developjik@gmail.com>
4+
정인권 <developjik@gmail.com> 정인권 <developjik@gmail.com>

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 정인권 (developjik)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ AI 사용을 금지하는 기회는 기록만 하고 화면에서 뺀다. 각
4747

4848
수집은 **fetch 우선**이다. 발견은 fetch로 하고(브라우저 페이지 상한을 쓰지 않는다), 브라우저는 JS 렌더가 필요한 상세와 재방문에만 쓴다. 소스의 URL·비용·상태는 `collector/sources.json` 한 곳에 모으고, 성과 없는 소스는 T3 월간 리포트에서 `retired`로 내린다.
4949

50-
## 숫자 (2026-11-12 기준)
50+
## 숫자 (2026-11-16 기준)
5151

5252
| 항목 | 값 |
5353
|---|---|
54-
| 추적 레코드 | 192건 (채용 공고 52 · 이벤트 140) |
55-
| 지금 열려 있는 기회 | 123건 |
56-
| AI 정책을 명시한 진행중 항목 | 92건 (그중 AI 필수 77건) |
57-
| 피드 발행 항목 | 114건 (RSS + JSON Feed 동일 목록) |
54+
| 추적 레코드 | 206건 (채용 공고 54 · 이벤트 152) |
55+
| 지금 열려 있는 기회 | 104건 (채용 공고 33 · 이벤트 71) |
56+
| AI 정책을 명시한 진행중 항목 | 74건 (그중 AI 필수 61건) |
57+
| 피드 발행 항목 | 104건 (RSS + JSON Feed 동일 목록) |
5858
| 골든케이스 | 6/6 (정책 판정 회귀 방지) |
5959
| 안티-슬롭 검사 | 16체크, 빌드 실패 시 배포 중단 |
6060
| 운영비 | ₩0 (GitHub Actions + Pages 무료 쿼터, 외부 DB·서버 없음) |
6161

62-
숫자는 데이터가 아니라 `data/meta.json`과 빌드가 계산한다. 이 표는 마지막 갱신 시점의 스냅샷이다.
62+
이 표는 사람이 고치지 않는다. 배포마다 `scripts/sync-readme.mjs`가 `data/*.json` 실측으로 다시 쓴다.
6363

6464
## 웹 (web/)
6565

@@ -138,3 +138,8 @@ React 18 · Rollup 3 · Babel · Terser · Node.js 20 (ESM) · Python 3 (쇼츠
138138
- [docs/design/anti-slop.md](docs/design/anti-slop.md) — AI 티 나는 UI 패턴 조사와 금지 목록
139139
- [collector/ROUTINE_PROMPT.md](collector/ROUTINE_PROMPT.md) — 매일 수집 세션 프롬프트
140140
- [web/README.md](web/README.md) — 웹 빌드 세부
141+
142+
## 라이선스
143+
144+
- 코드: [MIT](LICENSE)
145+
- 데이터(`data/*.json`, `data/guides/`): [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/deed.ko) — 출처("과제 지도" + 링크)를 표시하면 자유롭게 재사용·가공할 수 있다. 공고 원문 전문은 저장하지 않으므로(제목·근거 문장만) 원문 저작권은 각 출처에 있다.

‎scripts/sync-readme.mjs‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/usr/bin/env node
2+
// sync-readme.mjs — README '## 숫자' 섹션을 data/*.json 실측으로 다시 쓴다.
3+
// 로컬: node scripts/sync-readme.mjs (멱등 — 같은 날 두 번 돌리면 diff 없음)
4+
// 배포: .github/workflows/deploy.yml 의 sync-readme 잡이 매 배포마다 실행하고
5+
// 바뀌면 github-actions[bot] 이 커밋한다. GITHUB_TOKEN 푸시는 deploy 를
6+
// 다시 트리거하지 않으므로 무한루프가 없다.
7+
// 규칙: 이 섹션을 손으로 고치지 않는다. 정의가 바뀌면 이 스크립트를 고친다.
8+
import fs from 'node:fs'
9+
import path from 'node:path'
10+
import { collectFeedItems } from '../web/scripts/generate-feeds.mjs'
11+
12+
const repo = path.resolve(import.meta.dirname, '..')
13+
const read = (f) => JSON.parse(fs.readFileSync(path.join(repo, f), 'utf8'))
14+
const postings = read('data/postings.json')
15+
const events = read('data/events.json')
16+
17+
const OPEN_EVENT = new Set(['open', 'upcoming'])
18+
// '명시' = 정책 문구를 찾은 것 (미언급 unspecified / 확인필요 unknown 제외, 금지 banned 포함)
19+
const STATED_POLICY = new Set(['required', 'allowed_graded', 'allowed', 'banned'])
20+
const STATED_USAGE = new Set(['required', 'allowed_graded', 'allowed', 'banned'])
21+
22+
const openPostings = postings.filter((p) => p.status === 'open')
23+
const openEvents = events.filter((e) => OPEN_EVENT.has(e.status))
24+
const stated =
25+
openPostings.filter((p) => STATED_POLICY.has(p.ai_policy)).length +
26+
openEvents.filter((e) => STATED_USAGE.has(e.ai_usage)).length
27+
const requiredCount =
28+
openPostings.filter((p) => p.ai_policy === 'required').length +
29+
openEvents.filter((e) => e.ai_usage === 'required').length
30+
31+
// 피드 항목 수는 진짜 피드 생성 로직(collectFeedItems)과 똑같이 센다.
32+
const feedItems = collectFeedItems(path.join(repo, 'data')).items.length
33+
34+
// 골든케이스는 설정 개수가 아니라 실측 통과 수를 쓴다: validate.mjs 를 직접 돌려
35+
// '골든케이스 X/Y' 출력을 읽는다. validate 실패면 이 스크립트도 실패한다 —
36+
// 깨진 데이터로 README를 갱신하지 않는다(Codex PR 리뷰 반영).
37+
let goldenPass = 0
38+
let goldenTotal = 0
39+
try {
40+
const out = execFileSync(process.execPath, [path.join(repo, 'collector/validate.mjs')], {
41+
encoding: 'utf8',
42+
stdio: ['ignore', 'pipe', 'pipe'],
43+
})
44+
const m = out.match(/골든케이스 (\d+)\/(\d+)/)
45+
if (!m) {
46+
console.error('sync-readme: validate.mjs 출력에서 골든케이스 X/Y를 못 찾았다 — 메시지 형식이 바뀌면 이 정규식을 고친다')
47+
process.exit(1)
48+
}
49+
goldenPass = Number(m[1])
50+
goldenTotal = Number(m[2])
51+
} catch (e) {
52+
console.error('sync-readme: validate.mjs 실패 — README를 갱신하지 않는다')
53+
console.error(String((e && e.stdout) || e))
54+
process.exit(1)
55+
}
56+
57+
// 안티-슬롭 체크 수: 린터 자체 출력('N체크')에서 읽는다. 실패 시 표기 유지.
58+
import { execFileSync } from 'node:child_process'
59+
let lintCount = 16
60+
try {
61+
const lintOut = execFileSync(process.execPath, [path.join(repo, 'web/scripts/slop-lint.mjs')], {
62+
encoding: 'utf8',
63+
})
64+
lintCount = Number((lintOut.match(/(\d+)체크/) || [])[1]) || 16
65+
} catch {
66+
// 린터 실패는 빌드 잡이 잡는다. 여기선 숫자만 못 얻은 것.
67+
}
68+
69+
const kstToday = new Date(Date.now() + 9 * 3600 * 1000).toISOString().slice(0, 10)
70+
71+
const section = `## 숫자 (${kstToday} 기준)
72+
73+
| 항목 | 값 |
74+
|---|---|
75+
| 추적 레코드 | ${postings.length + events.length}건 (채용 공고 ${postings.length} · 이벤트 ${events.length}) |
76+
| 지금 열려 있는 기회 | ${openPostings.length + openEvents.length}건 (채용 공고 ${openPostings.length} · 이벤트 ${openEvents.length}) |
77+
| AI 정책을 명시한 진행중 항목 | ${stated}건 (그중 AI 필수 ${requiredCount}건) |
78+
| 피드 발행 항목 | ${feedItems}건 (RSS + JSON Feed 동일 목록) |
79+
| 골든케이스 | ${goldenPass}/${goldenTotal} (정책 판정 회귀 방지) |
80+
| 안티-슬롭 검사 | ${lintCount}체크, 빌드 실패 시 배포 중단 |
81+
| 운영비 | ₩0 (GitHub Actions + Pages 무료 쿼터, 외부 DB·서버 없음) |
82+
83+
이 표는 사람이 고치지 않는다. 배포마다 \`scripts/sync-readme.mjs\`가 \`data/*.json\` 실측으로 다시 쓴다.`
84+
85+
const readmePath = path.join(repo, 'README.md')
86+
const lines = fs.readFileSync(readmePath, 'utf8').split('\n')
87+
const start = lines.findIndex((l) => l.startsWith('## 숫자 ('))
88+
const end = lines.findIndex((l) => l.includes('스냅샷이다') || l.includes('다시 쓴다'))
89+
if (start < 0 || end < start) {
90+
console.error('sync-readme: README 숫자 섹션을 못 찾았다 — 섹션이 옮겨갔으면 스크립트를 고친다')
91+
process.exit(1)
92+
}
93+
const next = [...lines.slice(0, start), ...section.split('\n'), ...lines.slice(end + 1)]
94+
// 3연속 이상 개행(섹션 교체 잔해)은 빈 줄 1개로 정규화한다.
95+
fs.writeFileSync(readmePath, next.join('\n').replace(/\n{3,}/g, '\n\n'))
96+
console.log(
97+
`SYNC-README OK — ${kstToday} 기준 · 레코드 ${postings.length + events.length} · 열림 ${openPostings.length + openEvents.length} · 명시 ${stated} (필수 ${requiredCount}) · 피드 ${feedItems} · 골든 ${goldenPass}/${goldenTotal} · 슬롭린트 ${lintCount}`,
98+
)

0 commit comments

Comments
 (0)