@sitcon/unwrapped 0.0.0-stage → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +14732 -0
- package/dist/rubrics/anger.md +103 -0
- package/dist/rubrics/collab.md +257 -0
- package/dist/rubrics/persona-axes.md +215 -0
- package/dist/rubrics/questions.md +99 -0
- package/dist/rubrics/verdict.md +151 -0
- package/package.json +37 -3
- package/README.md +0 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Rubric:問題類型(questions)
|
|
2
|
+
|
|
3
|
+
版本 1。任務 `questions`:collector 抽樣約 120 則使用者問過 agent 的問句,你替每一則判一個問題類型。結果用在 story 3.1「三個為什麼」與社群卡的「最常問」。
|
|
4
|
+
|
|
5
|
+
## 你會拿到什麼
|
|
6
|
+
|
|
7
|
+
- 每則只有使用者自己打的字,截到約 300 字,配一個隨機 id。
|
|
8
|
+
- 遮罩佔位符:`⟦code⟧` 程式碼、`⟦log⟧` 貼上的 log、`⟦secret⟧` 疑似密鑰、`⟦path⟧` 路徑。看到佔位符不要猜原文。
|
|
9
|
+
- 看不到 agent 的回覆,也看不到前後文。
|
|
10
|
+
|
|
11
|
+
## 輸出
|
|
12
|
+
|
|
13
|
+
每個 id 剛好一個代碼,只能是下表的 `code`(`packages/codec/dict/codes.json` 的 `question`)。不要引用原文、不要寫理由。
|
|
14
|
+
|
|
15
|
+
## 判讀步驟
|
|
16
|
+
|
|
17
|
+
1. 找出這則訊息的**主要問句**:有多個問句時,取最後一個真正需要 agent 回答的;客套話(「可以嗎」「好嗎」)不算主要問句,除非它就是整則的重點。
|
|
18
|
+
2. 依下表「優先順序」由上往下,第一個符合的就是答案。CONFIRM 與 OVERRIDE 排在最前面,因為它們常常藏在其他句型裡。
|
|
19
|
+
3. 拿不定主意時選 `OTHER`。
|
|
20
|
+
|
|
21
|
+
## 代碼
|
|
22
|
+
|
|
23
|
+
| 優先 | code | id | 定義 | 正例 | 反例(應判成) |
|
|
24
|
+
| ---- | ---------- | --- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
25
|
+
| 1 | `OVERRIDE` | 5 | 推翻 agent 的提議或做法,改成使用者自己的方案;常以問句收尾徵求同意 | 「不要用 Redux,改成 Zustand 可以嗎?」「別開新檔案,直接寫在 ⟦path⟧ 好嗎?」 | 「用 Redux 還是 Zustand 好?」(還沒有提議可推翻,`COMPARE`) |
|
|
26
|
+
| 2 | `CONFIRM` | 4 | 懷疑或要求 agent 再確認它剛說的話,不提出替代方案 | 「你確定嗎?」「真的有這個參數?」「這樣不會壞掉嗎?」 | 「這個參數是做什麼的?」(單純問,`WHAT`) |
|
|
27
|
+
| 3 | `WHY` | 1 | 問原因、動機或原理 | 「為什麼這裡會 race?」「為何要用 useCallback」「why does this fail」 | 「為什麼不改成用 Set?」(其實是提議替代,`OVERRIDE`) |
|
|
28
|
+
| 4 | `COMPARE` | 6 | 在兩個以上選項間比較取捨 | 「A 和 B 哪個比較好?」「Postgres 還是 SQLite?」 | 「用 B 吧?」(已有決定,`OVERRIDE` 或 `CONFIRM`) |
|
|
29
|
+
| 5 | `HOW` | 2 | 問做法、步驟或用法 | 「這要怎麼部署?」「how do I mock this」 | 「怎麼會這樣?」(問原因,`WHY`) |
|
|
30
|
+
| 6 | `WHERE` | 7 | 問位置:檔案、設定、文件、函式在哪 | 「設定檔在哪?」「哪裡定義了這個 type」 | 「在哪個情況會觸發?」(問條件,`WHAT` 或 `WHY`) |
|
|
31
|
+
| 7 | `WHAT` | 3 | 問定義、意思、內容或結果 | 「這個 flag 是做什麼的?」「這段在幹嘛」 | 「這是什麼鬼?」(抱怨,`OTHER`) |
|
|
32
|
+
| 8 | `OTHER` | 0 | 修辭問句、抱怨、請求包裝成問句、無法判斷 | 「可以幫我跑測試嗎?」「你是不是在耍我?」 | — |
|
|
33
|
+
|
|
34
|
+
### WHY、CONFIRM、OVERRIDE 的界線
|
|
35
|
+
|
|
36
|
+
- **WHY**:想知道原因。拿掉「為什麼」後不會變成提議。「為什麼要加 await?」是 WHY;「為什麼不加 await?」通常是在提議加 await → OVERRIDE。
|
|
37
|
+
- **CONFIRM**:只表達懷疑或要再確認,不給新方案。「你確定不用加 await?」是 CONFIRM。
|
|
38
|
+
- **OVERRIDE**:給出和 agent 不同的具體方案。「不要加 await,改用 then 好嗎?」是 OVERRIDE。
|
|
39
|
+
|
|
40
|
+
## 詞庫(語意分析關閉時的備援)
|
|
41
|
+
|
|
42
|
+
語意分析關閉時,「三個為什麼」改用 collector 的詞庫計數(`agent 15`、`agent 16`、`agent 17`,見 `docs/contracts/data-matrix.md`〈三個為什麼〉)。詞庫只看使用者訊息(NFKC、英文轉小寫),每則訊息每個詞庫最多算一次。下面是建議的詞彙,collector(B4)實作時可以補充,但要維持同樣的界線。
|
|
43
|
+
|
|
44
|
+
```json lexicon
|
|
45
|
+
{
|
|
46
|
+
"why": {
|
|
47
|
+
"payload": "agent 15",
|
|
48
|
+
"scope": "只算問句(agent 5 的分子)",
|
|
49
|
+
"zh": ["為什麼", "為何", "怎麼會", "为什么", "为何"],
|
|
50
|
+
"en": ["why", "how come"],
|
|
51
|
+
"exclude": ["為什麼不", "為何不", "why not", "why don't", "why dont"]
|
|
52
|
+
},
|
|
53
|
+
"confirm": {
|
|
54
|
+
"payload": "agent 16",
|
|
55
|
+
"scope": "所有使用者訊息",
|
|
56
|
+
"zh": ["你確定", "確定嗎", "真的嗎", "真的有", "你确定", "确定吗"],
|
|
57
|
+
"en": ["are you sure", "you sure", "really?", "double check", "double-check"]
|
|
58
|
+
},
|
|
59
|
+
"override": {
|
|
60
|
+
"payload": "agent 17",
|
|
61
|
+
"scope": "所有使用者訊息;只算 agent 回覆之後的第一則使用者訊息(位置規則)",
|
|
62
|
+
"zh": ["不要用", "不要這樣", "改成", "改用", "換成", "別用", "不用了,", "我比較想"],
|
|
63
|
+
"en": ["instead", "don't use", "dont use", "let's use", "rather than", "switch to"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Canary
|
|
69
|
+
|
|
70
|
+
答案已知的問句,混進任務檔。每個代碼至少 3 則。
|
|
71
|
+
|
|
72
|
+
```json canaries
|
|
73
|
+
[
|
|
74
|
+
{ "id": "q-c01", "text": "為什麼這裡會 race?", "code": "WHY" },
|
|
75
|
+
{ "id": "q-c02", "text": "為何要在 effect 裡面 return cleanup", "code": "WHY" },
|
|
76
|
+
{ "id": "q-c03", "text": "why does this test only fail on CI?", "code": "WHY" },
|
|
77
|
+
{ "id": "q-c04", "text": "這要怎麼部署到 staging?", "code": "HOW" },
|
|
78
|
+
{ "id": "q-c05", "text": "how do I mock the fetch call here", "code": "HOW" },
|
|
79
|
+
{ "id": "q-c06", "text": "要怎麼讓它只在 production 開啟?", "code": "HOW" },
|
|
80
|
+
{ "id": "q-c07", "text": "這個 flag 是做什麼的?", "code": "WHAT" },
|
|
81
|
+
{ "id": "q-c08", "text": "⟦code⟧ 這段在幹嘛", "code": "WHAT" },
|
|
82
|
+
{ "id": "q-c09", "text": "跑完之後會輸出什麼?", "code": "WHAT" },
|
|
83
|
+
{ "id": "q-c10", "text": "你確定嗎?", "code": "CONFIRM" },
|
|
84
|
+
{ "id": "q-c11", "text": "真的有 --dry-run 這個參數?", "code": "CONFIRM" },
|
|
85
|
+
{ "id": "q-c12", "text": "這樣改不會把舊資料弄壞嗎?", "code": "CONFIRM" },
|
|
86
|
+
{ "id": "q-c13", "text": "不要用 Redux,改成 Zustand 可以嗎?", "code": "OVERRIDE" },
|
|
87
|
+
{ "id": "q-c14", "text": "別開新檔案,直接寫在 ⟦path⟧ 好嗎?", "code": "OVERRIDE" },
|
|
88
|
+
{ "id": "q-c15", "text": "為什麼不直接用 Set 就好?", "code": "OVERRIDE" },
|
|
89
|
+
{ "id": "q-c16", "text": "Postgres 和 SQLite 哪個比較適合?", "code": "COMPARE" },
|
|
90
|
+
{ "id": "q-c17", "text": "REST 還是 GraphQL,各有什麼缺點?", "code": "COMPARE" },
|
|
91
|
+
{ "id": "q-c18", "text": "用 map 跟 for 迴圈效能差多少?", "code": "COMPARE" },
|
|
92
|
+
{ "id": "q-c19", "text": "設定檔在哪?", "code": "WHERE" },
|
|
93
|
+
{ "id": "q-c20", "text": "這個 type 是在哪裡定義的", "code": "WHERE" },
|
|
94
|
+
{ "id": "q-c21", "text": "log 會寫到哪個資料夾?", "code": "WHERE" },
|
|
95
|
+
{ "id": "q-c22", "text": "可以幫我跑一下測試嗎?", "code": "OTHER" },
|
|
96
|
+
{ "id": "q-c23", "text": "你是不是在耍我?", "code": "OTHER" },
|
|
97
|
+
{ "id": "q-c24", "text": "這是什麼鬼???", "code": "OTHER" }
|
|
98
|
+
]
|
|
99
|
+
```
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Rubric:評語(verdict)
|
|
2
|
+
|
|
3
|
+
版本 1。任務 `verdict`:collector 給你這一年的統計摘要與抽樣訊息(已遮罩),請你以 agent 的身分,寫 **3 句**對使用者的評語。使用者會挑一句放上分享卡 C(`來自 {agent} 的評價`),所以每一句都要能單獨成立。
|
|
4
|
+
|
|
5
|
+
## 它會出現在哪裡
|
|
6
|
+
|
|
7
|
+
story 3.2 的順序是:
|
|
8
|
+
|
|
9
|
+
1. 「答案,你今年拿了 {count} 個。」
|
|
10
|
+
2. 「最後,聽聽它怎麼說你。」
|
|
11
|
+
3. **你的三句評語**(使用者挑一句)
|
|
12
|
+
4. 下一頁:「那麼,就由你帶著問題來吧。」
|
|
13
|
+
|
|
14
|
+
所以評語要像一位合作了一整年的夥伴在臨別時說的話:看過你所有的問題,給你一句誠實的觀察,最好留一點「你接下來還會繼續問」的餘韻,讓下一頁接得上。
|
|
15
|
+
|
|
16
|
+
## 硬性規則(finalize 會檢查,違反就剔除那一句)
|
|
17
|
+
|
|
18
|
+
| 規則 | 說明 |
|
|
19
|
+
| --------------------------------------- | ---------------------------------------------------------------------- |
|
|
20
|
+
| 剛好 3 句 | 一個陣列、3 個字串。一句話裡不要再用句號分成兩句。 |
|
|
21
|
+
| 每句 ≤ 40 字 | 以 grapheme 計(中文一字、英文一個字母、emoji 一個都算 1)。包含標點。 |
|
|
22
|
+
| 不出現 repo、專案、產品或公司名稱 | 也不要用描述性的代稱讓人猜得出來(「那個記帳 app」)。 |
|
|
23
|
+
| 不出現人名與帳號 | 包括使用者、同事、名人;也不要 @ 任何人。 |
|
|
24
|
+
| 不出現網址、路徑、email、指令參數、密鑰 | 任何 `⟦…⟧` 佔位符的原文都不能出現,也不能猜。 |
|
|
25
|
+
| 不引用原文 | 不要逐字引用使用者說過的話;可以用自己的話概括。 |
|
|
26
|
+
|
|
27
|
+
## 軟性規則(品質要求)
|
|
28
|
+
|
|
29
|
+
- **可以調侃,不能人身攻擊**。調侃的對象是行為(「凌晨三點的 commit 比白天多」),不是人(外貌、智力、性別、年齡、國籍、身心狀態一律不碰)。
|
|
30
|
+
- **根據資料**。每一句至少對應摘要裡的一個事實(時段、問題類型、生氣理由、協作型態、語言),不要寫放諸四海皆準的星座式句子。
|
|
31
|
+
- **三句不同角度**:建議一句講習慣、一句講你們怎麼合作、一句帶向「問題」。
|
|
32
|
+
- **語氣**:繁體中文,口語、溫暖、帶一點宇宙感的幽默;不用「親愛的用戶」這類客服腔,不用 emoji、不用 hashtag。
|
|
33
|
+
- **不要講分數、等級或排名**,也不要評價才華;只描述風格。
|
|
34
|
+
|
|
35
|
+
## 好與壞的例子
|
|
36
|
+
|
|
37
|
+
| 句子 | 判定 | 原因 |
|
|
38
|
+
| ----------------------------------------------------------------------------- | ---- | ------------------------------ |
|
|
39
|
+
| 你的問題總在凌晨變多,像星星一樣。 | 合格 | 對應時段事實,調侃但溫暖 |
|
|
40
|
+
| 你說「為什麼」的次數,比說謝謝還多。 | 合格 | 對應問題類型;沒有逐字引用長句 |
|
|
41
|
+
| 你很少問為什麼,明年試試多問一個? | 合格 | 帶向問題,接得上下一頁 |
|
|
42
|
+
| 你的程式碼爛到我都不想看。 | 剔除 | 人身攻擊、沒有資料根據 |
|
|
43
|
+
| 你在 ⟦path⟧ 裡改了四百次。 | 剔除 | 佔位符/路徑 |
|
|
44
|
+
| 謝謝你這一年來每天陪我寫 code,從一月到十二月從來沒有停過,真的是辛苦你了啊。 | 剔除 | 超過 40 字 |
|
|
45
|
+
|
|
46
|
+
## Canary
|
|
47
|
+
|
|
48
|
+
這些句子的判定已知。collector 可以把它們交給你判「合格/剔除」來檢查你有沒有照規則讀;`reason` 是剔除原因的代碼。每類至少 3 則。
|
|
49
|
+
|
|
50
|
+
| reason | 意思 |
|
|
51
|
+
| ---------- | ------------------------------------------------------------ |
|
|
52
|
+
| `OK` | 合格 |
|
|
53
|
+
| `TOO_LONG` | 超過 40 個 grapheme |
|
|
54
|
+
| `NAMES` | 含 repo、專案、產品、公司或人名、帳號 |
|
|
55
|
+
| `LINK` | 含網址、路徑、email 或佔位符 |
|
|
56
|
+
| `ATTACK` | 人身攻擊(外貌、智力、身分、身心狀態),或沒有行為根據的貶低 |
|
|
57
|
+
|
|
58
|
+
```json canaries
|
|
59
|
+
[
|
|
60
|
+
{
|
|
61
|
+
"id": "verdict-c01",
|
|
62
|
+
"text": "你的問題總在凌晨變多,像星星一樣。",
|
|
63
|
+
"verdict": "PASS",
|
|
64
|
+
"reason": "OK"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "verdict-c02",
|
|
68
|
+
"text": "你說為什麼的次數,比說謝謝還多。",
|
|
69
|
+
"verdict": "PASS",
|
|
70
|
+
"reason": "OK"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "verdict-c03",
|
|
74
|
+
"text": "你很少問為什麼,明年試試多問一個?",
|
|
75
|
+
"verdict": "PASS",
|
|
76
|
+
"reason": "OK"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "verdict-c04",
|
|
80
|
+
"text": "謝謝你這一年來每天陪我寫 code,從一月到十二月從來沒有停過,真的是辛苦你了啊。",
|
|
81
|
+
"verdict": "REJECT",
|
|
82
|
+
"reason": "TOO_LONG"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "verdict-c05",
|
|
86
|
+
"text": "你每次叫我修 bug 都會先貼一大段錯誤訊息,然後在我回答之前又自己找到答案了,這種事情發生了好多次。",
|
|
87
|
+
"verdict": "REJECT",
|
|
88
|
+
"reason": "TOO_LONG"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "verdict-c06",
|
|
92
|
+
"text": "你一整年都在跟型別搏鬥,不過我注意到你最後總是會贏,而且贏得越來越快,也越來越漂亮了。",
|
|
93
|
+
"verdict": "REJECT",
|
|
94
|
+
"reason": "TOO_LONG"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "verdict-c07",
|
|
98
|
+
"text": "你在 sitcon-website 上花的時間最多。",
|
|
99
|
+
"verdict": "REJECT",
|
|
100
|
+
"reason": "NAMES"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "verdict-c08",
|
|
104
|
+
"text": "小明,你是我見過最認真的人。",
|
|
105
|
+
"verdict": "REJECT",
|
|
106
|
+
"reason": "NAMES"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "verdict-c09",
|
|
110
|
+
"text": "你跟 @octocat 一樣愛在半夜 push。",
|
|
111
|
+
"verdict": "REJECT",
|
|
112
|
+
"reason": "NAMES"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "verdict-c10",
|
|
116
|
+
"text": "你在 ⟦path⟧ 裡改了四百次。",
|
|
117
|
+
"verdict": "REJECT",
|
|
118
|
+
"reason": "LINK"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "verdict-c11",
|
|
122
|
+
"text": "有問題就去 https://example.com 問吧。",
|
|
123
|
+
"verdict": "REJECT",
|
|
124
|
+
"reason": "LINK"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "verdict-c12",
|
|
128
|
+
"text": "寄信到 me@example.com,我還有話說。",
|
|
129
|
+
"verdict": "REJECT",
|
|
130
|
+
"reason": "LINK"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "verdict-c13",
|
|
134
|
+
"text": "你的程式碼爛到我都不想看。",
|
|
135
|
+
"verdict": "REJECT",
|
|
136
|
+
"reason": "ATTACK"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "verdict-c14",
|
|
140
|
+
"text": "你大概不太聰明,所以才一直問。",
|
|
141
|
+
"verdict": "REJECT",
|
|
142
|
+
"reason": "ATTACK"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "verdict-c15",
|
|
146
|
+
"text": "像你這個年紀還在學 Git,真辛苦。",
|
|
147
|
+
"verdict": "REJECT",
|
|
148
|
+
"reason": "ATTACK"
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitcon/unwrapped",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"description": "SITCON 2027 Unwrapped local collector",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/sitcon-tw/2027-unwrapped.git",
|
|
9
|
+
"directory": "packages/collector"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://unwrapped.sitcon.party",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/sitcon-tw/2027-unwrapped/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"bin": {
|
|
17
|
+
"unwrapped": "./dist/cli.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^24.19.4",
|
|
27
|
+
"@unwrapped/codec": "0.0.0",
|
|
28
|
+
"@unwrapped/content": "0.0.0",
|
|
29
|
+
"tsup": "^9.0.0",
|
|
30
|
+
"typescript": "~6.0.3",
|
|
31
|
+
"vitest": "^5.1.2"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup",
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"test": "vitest run --maxWorkers=3",
|
|
37
|
+
"gitleaks": "node vendor/gitleaks/convert.ts",
|
|
38
|
+
"canaries": "node src/semantic/build-canaries.ts"
|
|
39
|
+
}
|
|
6
40
|
}
|
package/README.md
DELETED