create-ccc-tutor 0.1.0
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/README.md +41 -0
- package/bin/cli.js +76 -0
- package/package.json +28 -0
- package/template/.claude/commands/abandon.md +7 -0
- package/template/.claude/commands/add-anti-flag.md +7 -0
- package/template/.claude/commands/add-constitution-clause.md +7 -0
- package/template/.claude/commands/audit-spec.md +7 -0
- package/template/.claude/commands/commit.md +7 -0
- package/template/.claude/commands/constitution-edit.md +7 -0
- package/template/.claude/commands/db-schema.md +7 -0
- package/template/.claude/commands/exam.md +66 -0
- package/template/.claude/commands/execution-plan.md +7 -0
- package/template/.claude/commands/feature-draft.md +7 -0
- package/template/.claude/commands/handoff.md +7 -0
- package/template/.claude/commands/implement.md +7 -0
- package/template/.claude/commands/init.md +7 -0
- package/template/.claude/commands/next.md +7 -0
- package/template/.claude/commands/offload.md +7 -0
- package/template/.claude/commands/pickup.md +7 -0
- package/template/.claude/commands/recall.md +7 -0
- package/template/.claude/commands/remember.md +7 -0
- package/template/.claude/commands/slide.md +87 -0
- package/template/.claude/commands/spec-finalize.md +7 -0
- package/template/.claude/commands/test-fix.md +7 -0
- package/template/.claude/commands/uninstall.md +7 -0
- package/template/.claude/settings.json +161 -0
- package/template/.claude-plugin/plugin.json +41 -0
- package/template/.codex/config.toml +24 -0
- package/template/.codex/hooks.json +4 -0
- package/template/.codex/install-skills.sh +18 -0
- package/template/.codex/skills/exam/SKILL.md +61 -0
- package/template/.codex/skills/slide/SKILL.md +69 -0
- package/template/.harness/agents/README.md +70 -0
- package/template/.harness/agents/_template/junior-agent-template.md +116 -0
- package/template/.harness/agents/backend-reviewer.md +153 -0
- package/template/.harness/agents/frontend-reviewer.md +158 -0
- package/template/.harness/agents/security-reviewer.md +148 -0
- package/template/.harness/agents/test-fixer.md +147 -0
- package/template/.harness/docs/doc-sync.md +29 -0
- package/template/.harness/docs/git-hygiene.md +56 -0
- package/template/.harness/docs/spec-model.md +47 -0
- package/template/.harness/docs/tool-map.md +120 -0
- package/template/.harness/docs/workflow.md +59 -0
- package/template/.harness/scripts/README.md +70 -0
- package/template/.harness/scripts/auditor-gate.sh +388 -0
- package/template/.harness/scripts/bootstrap-check.sh +103 -0
- package/template/.harness/scripts/budget-monitor.sh +223 -0
- package/template/.harness/scripts/check-prereqs.sh +165 -0
- package/template/.harness/scripts/checkpoint-recall.sh +136 -0
- package/template/.harness/scripts/checkpoint-write.sh +281 -0
- package/template/.harness/scripts/decision-log-append.sh +90 -0
- package/template/.harness/scripts/env-check.sh +286 -0
- package/template/.harness/scripts/format-edit.sh +80 -0
- package/template/.harness/scripts/lint-bans.sh +110 -0
- package/template/.harness/scripts/memory-archive.sh +129 -0
- package/template/.harness/scripts/memory-recall.sh +197 -0
- package/template/.harness/scripts/memory-snapshot.sh +124 -0
- package/template/.harness/scripts/post-migration.sh +58 -0
- package/template/.harness/scripts/precommit-cycles.sh +74 -0
- package/template/.harness/scripts/precommit-typecheck.sh +69 -0
- package/template/.harness/scripts/scratchpad-recall.sh +83 -0
- package/template/.harness/scripts/scratchpad-update.sh +39 -0
- package/template/.harness/scripts/standalone-bootstrap.md +443 -0
- package/template/.harness/skills/abandon/SKILL.md +157 -0
- package/template/.harness/skills/add-anti-flag/SKILL.md +205 -0
- package/template/.harness/skills/add-constitution-clause/SKILL.md +244 -0
- package/template/.harness/skills/audit-spec/SKILL.md +395 -0
- package/template/.harness/skills/commit/SKILL.md +270 -0
- package/template/.harness/skills/constitution-edit/SKILL.md +292 -0
- package/template/.harness/skills/db-schema/SKILL.md +145 -0
- package/template/.harness/skills/db-schema/references/methodology.md +202 -0
- package/template/.harness/skills/execution-plan/SKILL.md +346 -0
- package/template/.harness/skills/feature-draft/SKILL.md +426 -0
- package/template/.harness/skills/handoff/SKILL.md +211 -0
- package/template/.harness/skills/implement/SKILL.md +355 -0
- package/template/.harness/skills/init/SKILL.md +805 -0
- package/template/.harness/skills/next/SKILL.md +245 -0
- package/template/.harness/skills/offload/SKILL.md +134 -0
- package/template/.harness/skills/pickup/SKILL.md +213 -0
- package/template/.harness/skills/recall/SKILL.md +159 -0
- package/template/.harness/skills/remember/SKILL.md +205 -0
- package/template/.harness/skills/spec-finalize/SKILL.md +196 -0
- package/template/.harness/skills/test-fix/SKILL.md +363 -0
- package/template/.harness/skills/uninstall/SKILL.md +370 -0
- package/template/.harness/state/install.json +83 -0
- package/template/AGENTS.md +262 -0
- package/template/CCC_MAGI_LICENSE +201 -0
- package/template/CCC_MAGI_README.md +986 -0
- package/template/CLAUDE.md +658 -0
- package/template/codex.md +39 -0
- package/template/constitution.md +164 -0
- package/template/course/README.md +15 -0
- package/template/course/course_code(example)/exam/README.md +2 -0
- package/template/course/course_code(example)/slide/slide_example-1.pdf +40 -0
- package/template/course/course_code(example)/slide/slide_example-2.pdf +40 -0
- package/template/docs/features/slide-query-implementation.md +79 -0
- package/template/docs/features/slide-query.md +211 -0
- package/template/docs-harness/README.md +42 -0
- package/template/docs-harness/adoption-playbook.md +373 -0
- package/template/docs-harness/ccc-step1-driver-template.md +288 -0
- package/template/docs-harness/cli-configs-README.md +78 -0
- package/template/docs-harness/context-architecture-v2.md +249 -0
- package/template/docs-harness/design-spec.md +437 -0
- package/template/docs-harness/memory-layer.md +135 -0
- package/template/docs-harness/retrospective-notes.md +204 -0
- package/template/gitignore +106 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# CCC-tutor — Codex 入口指引
|
|
2
|
+
|
|
3
|
+
> 本文件是 Codex 的"指路牌"。Codex 的实际项目入口是 **`AGENTS.md`**(+ `.codex/config.toml`、`.codex/hooks.json`)。
|
|
4
|
+
> 宪法 §3 红线 #1 要求本项目同时支持 Claude 与 Codex;本文件保证 Codex 一侧也有明确入口。
|
|
5
|
+
|
|
6
|
+
## Claude 与 Codex 的关键差异(务必理解)
|
|
7
|
+
|
|
8
|
+
| | Claude Code | Codex |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| 自定义功能机制 | **斜杠命令** `.claude/commands/<名>.md` | **技能** `~/.codex/skills/<名>/SKILL.md` |
|
|
11
|
+
| 怎么触发 | 打 `/<名>`(如 `/slide`) | **不打斜杠**;模型按技能的 `description` **自动判断何时调用**,你用自然语言问即可 |
|
|
12
|
+
| 发现位置 | 直接读项目 `.claude/commands/` | 只读 `~/.codex/skills/`,**不读项目级** → 需安装脚本复制过去 |
|
|
13
|
+
|
|
14
|
+
> ⚠️ 在 Codex 里**没有 `/slide` 这个斜杠命令**(打了会报 "Unrecognized command")。正确用法见下。
|
|
15
|
+
|
|
16
|
+
## 用 Codex 运行本项目
|
|
17
|
+
|
|
18
|
+
1. **首次(或改了技能后)先安装技能**:`bash .codex/install-skills.sh`
|
|
19
|
+
- 把项目 `.codex/skills/*` 复制到 `~/.codex/skills/`(Codex 只从这里加载技能)。
|
|
20
|
+
- 项目里的 `.codex/skills/<名>/SKILL.md` 是单一事实源;改完重跑脚本 + 重启 Codex 生效。
|
|
21
|
+
2. 在项目根目录运行 `codex`。
|
|
22
|
+
3. **先告诉它科目**(如 `course_code(example)`);没说且有多个科目时它会先问,单科目直接用。当前会话科目记在 `.harness/state/current-subject.txt`,除非更换整段会话沿用。
|
|
23
|
+
4. **用自然语言提问**触发技能,例如:
|
|
24
|
+
- 查知识点 → `根据课件回答:什么是置信区间?` → Codex 调用 **slide** 技能:只查当前科目 `course/<科目>/slide/` 的 PDF、标出处、找不到先问再补充。
|
|
25
|
+
- 解题目 → `看 <文件名> 里的第3题` 或直接说要解某文件的某题 → Codex 调用 **exam** 技能:在 `course/<科目>/exam/` 里定位题目并解答,依据优先引用课件。
|
|
26
|
+
|
|
27
|
+
## 已有功能(Claude ↔ Codex 对照)
|
|
28
|
+
|
|
29
|
+
| 功能 | Claude 版(打 `/命令`) | Codex 版(自然语言触发) |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| 课件查询 slide | `.claude/commands/slide.md` | `.codex/skills/slide/SKILL.md` → 装到 `~/.codex/skills/slide/` |
|
|
32
|
+
| 题目解答 exam | `.claude/commands/exam.md` | `.codex/skills/exam/SKILL.md` → 装到 `~/.codex/skills/exam/` |
|
|
33
|
+
|
|
34
|
+
## 规格来源(与 AI 无关,单一事实源)
|
|
35
|
+
|
|
36
|
+
- 每个功能的行为规格:`docs/features/<name>.md`
|
|
37
|
+
- 例:课件查询见 `docs/features/slide-query.md`
|
|
38
|
+
|
|
39
|
+
> 注意:Claude 的 Read 工具能直接渲染 PDF;Codex 需用 shell(`pdftotext` 或 `python3 + pypdf`)抽取 PDF 文字。两侧行为规则相同,仅"读 PDF 的手段"不同。
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# CCC-tutor — Constitution
|
|
2
|
+
|
|
3
|
+
<!-- Sync Impact Report
|
|
4
|
+
Version: 1.0.0 → 1.1.0 (MINOR — add Section 3 clause #1: 双系统 · 双 AI 兼容)
|
|
5
|
+
Modified items:
|
|
6
|
+
- Section 3 — added clause #1: 双系统 · 双 AI 兼容(Mac/Windows × Claude/Codex)
|
|
7
|
+
Templates needing update:
|
|
8
|
+
- N/A
|
|
9
|
+
Generated: 2026-06-09T01:03:04Z
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
<!-- This file is the PROJECT CONSTITUTION. It is loaded by every agent
|
|
13
|
+
(planner / programmer / reviewer / junior reviewers) BEFORE any
|
|
14
|
+
other harness file. It contains the things that, if violated,
|
|
15
|
+
mean this is no longer THIS project.
|
|
16
|
+
|
|
17
|
+
Three sections:
|
|
18
|
+
Section 1 — Universal core (harness-guaranteed; can't be removed)
|
|
19
|
+
Section 2 — Project identity (filled at /init; edit via /constitution-edit)
|
|
20
|
+
Section 3 — Project-specific red lines (starts empty; grows via /add-constitution-clause)
|
|
21
|
+
|
|
22
|
+
CLAUDE.md describes HOW to work (workflow, lanes, tools).
|
|
23
|
+
This file describes WHAT this project stands for. -->
|
|
24
|
+
|
|
25
|
+
<!-- ============================================================
|
|
26
|
+
SLOT REGISTRY (single source of truth for the whole harness)
|
|
27
|
+
|
|
28
|
+
Format: slot_name | level | source(s) | description
|
|
29
|
+
|
|
30
|
+
# L0 — must be filled before any work begins
|
|
31
|
+
project_name | L0 | AUTO(manifest:name) → ASK_USER | Project name
|
|
32
|
+
project_description | L0 | ASK_USER | One-sentence project intro (plain language)
|
|
33
|
+
project_stage | L0 | ASK_USER | early / beta / prod / scale
|
|
34
|
+
project_scale_target | L0 | ASK_USER | Target scale
|
|
35
|
+
team_size | L0 | DEFAULT(solo) → ASK | solo / small / large
|
|
36
|
+
primary_concern | L0 | ASK_USER | What the harness is primarily responsible for
|
|
37
|
+
out_of_scope_items | L0 | ASK_USER (list) | What the harness should NOT care about
|
|
38
|
+
auditor_model | L0 | DEFAULT(Codex) → ASK | Cross-model auditor display name; None = single-engine
|
|
39
|
+
auditor_model_id | L1 | DEFAULT(gpt-5.5) | Cross-model auditor version string (for CLI config; change via /constitution-edit)
|
|
40
|
+
language_mode | L0 | DEFAULT(plain) → ASK | plain / professional
|
|
41
|
+
spec_dir | L0 | DEFAULT(docs/features/) | Spec directory
|
|
42
|
+
implementation_dir | L0 | DEFAULT(docs/features/) | Implementation directory
|
|
43
|
+
|
|
44
|
+
# L0 — Constitution Section 2 identity slots
|
|
45
|
+
project_audience | L0 | ASK_USER | Who we serve (one sentence)
|
|
46
|
+
project_non_goals | L0 | ASK_USER | What we deliberately do NOT do
|
|
47
|
+
project_compliance | L0 | ASK_USER | Compliance floors (GDPR/HIPAA/PCI/none/other)
|
|
48
|
+
project_performance_floor | L0 | ASK_USER | Performance floors
|
|
49
|
+
project_identity_other | L0 | OPTIONAL | Other identity-level statements
|
|
50
|
+
|
|
51
|
+
# L1 — filled at appropriate stages
|
|
52
|
+
tech_stack | L1 | AUTO(scan manifests) | Primary tech stack
|
|
53
|
+
repo_structure | L1 | AUTO(scan fs) → CONFIRM | Repo structure
|
|
54
|
+
dependency_flow | L1 | ASK (optional) | Module dependency order
|
|
55
|
+
release_lanes | L1 | DEFAULT([git-push]) → ASK | Release lanes
|
|
56
|
+
backend_change_lane | L1 | OPTIONAL | Backend change lane
|
|
57
|
+
error_tracker | L1 | ASK | Error tracker
|
|
58
|
+
test_required | L1 | DEFAULT(true) → ASK | Whether automated tests are enabled
|
|
59
|
+
junior_reviewers | L1 | EXAMPLES → ASK | Which rule-enforcement reviewers to enable
|
|
60
|
+
rule_sources | L1 | EMPTY → GROW | Index of per-domain rule files
|
|
61
|
+
supported_locales | L1 | DEFAULT(["zh-Hans","en","ko"]) → ASK | Project-supported locales (i18n)
|
|
62
|
+
edge_case_categories | L1 | DEFAULT(5 universal) + 3 user | Edge-case round category list
|
|
63
|
+
test_framework | L1 | AUTO(scan deps) → CONFIRM | Test framework (jest/vitest/pytest, etc.)
|
|
64
|
+
test_runner_command | L1 | AUTO(scan scripts) | Test runner command
|
|
65
|
+
feature_folder_pattern | L1 | AUTO(scan fs) → CONFIRM | Feature folder pattern
|
|
66
|
+
client_code_paths | L1 | AUTO(scan fs) → CONFIRM | Frontend code path patterns (used to trigger reviewers)
|
|
67
|
+
backend_code_paths | L1 | OPTIONAL | Backend code path patterns (skipped if no backend)
|
|
68
|
+
backend_db_type | L1 | OPTIONAL | Database type; projects without a backend skip db-schema
|
|
69
|
+
high_trap_libraries | L1 | EXAMPLES → ASK | High-risk libraries requiring context7 version verification
|
|
70
|
+
migration_dir | L1 | OPTIONAL | Migration files directory (only if backend_db_type is set; typical default supabase/migrations/)
|
|
71
|
+
pii_columns | L1 | DEFAULT([phone,email,name,address,payment]) → ASK | PII column list (used by db-schema / security-reviewer)
|
|
72
|
+
rls_auth_function | L1 | OPTIONAL | Access-control auth-context expression (e.g., Postgres+RLS: (SELECT auth.uid()))
|
|
73
|
+
|
|
74
|
+
# L2 — grow over time
|
|
75
|
+
anti_flag_rules | L2 | EXAMPLES_AS_SEED + GROW | Anti-flag rules (in AGENTS.md)
|
|
76
|
+
project_red_lines | L2 | EMPTY → GROW | See Section 3 of this file
|
|
77
|
+
============================================================ -->
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Section 1 — Universal core
|
|
82
|
+
|
|
83
|
+
> **Shipped with the harness. These items are this harness's load-bearing invariants. They cannot be removed, overridden, or carved out — not by lane choice, not by direct CEO instruction, not under any circumstances. The harness exists to enforce these; remove them and the harness is no longer the harness. The CEO can ADD to them but cannot REMOVE them, even by direct instruction.**
|
|
84
|
+
|
|
85
|
+
### 1. Cross-model audit is mandatory
|
|
86
|
+
|
|
87
|
+
Every code change passes the auditor (Codex) audit at the appropriate gate. No lane exemption, no surface exemption. The auditor is independent of the implementer — that independence is the point.
|
|
88
|
+
|
|
89
|
+
**Single-engine fallback:** if `auditor_model = None`, the audit step still runs but uses a fresh-context invocation of the same model. Bias-cancellation guarantee weakens; the discipline of a second look remains.
|
|
90
|
+
|
|
91
|
+
Pure documentation, comment-only, formatting-only, and meta-file changes are exempt.
|
|
92
|
+
|
|
93
|
+
### 2. Data ownership red line
|
|
94
|
+
|
|
95
|
+
User data never leaks into logs, errors, cache, or cross-user responses. Server-side access control enforces; client trust never substitutes for enforcement. Keeping PII out of telemetry is non-negotiable.
|
|
96
|
+
|
|
97
|
+
### 3. CEO has final authority — except on Universal Core
|
|
98
|
+
|
|
99
|
+
The CEO has the final word on intent, scope, and lane. STRONG operating preferences (see `CLAUDE.md § Operating Principles`) ARE overridable by CEO with reasoning recorded in `## Decision history`.
|
|
100
|
+
|
|
101
|
+
**Exception:** Universal Core items (Section 1 of this file) are NOT overridable, even by direct CEO instruction. The CEO cannot direct a PII leak, cannot direct skipping the auditor, cannot direct shipping without smoke test, cannot direct removing this section. If a CEO instruction would violate a Universal Core item, the manager surfaces the conflict and the instruction must be reformulated; it cannot be carried out as-stated.
|
|
102
|
+
|
|
103
|
+
Authority rules:
|
|
104
|
+
- A CEO rejection on a STRONG item is final; no reason required.
|
|
105
|
+
- A CEO decision is followed; the manager (Tech Lead / Main Claude) carries it out.
|
|
106
|
+
- The manager may surface risks ("CEO, this carries X risk"); after the CEO decides, the discussion ends.
|
|
107
|
+
- A CEO decision stands even when the manager finds it illogical — surface the disagreement, then carry out the decision.
|
|
108
|
+
- A CEO approval scopes only what was actually requested. It does not authorize related actions, broader changes, or repeat application in future contexts.
|
|
109
|
+
|
|
110
|
+
### 4. Real-human smoke test is mandatory
|
|
111
|
+
|
|
112
|
+
AI's self-report of "done" does not count. Before any push to GitHub, the real-human user (CEO) must run the application manually against the spec's smoke-test procedures (Stage 7 of `CLAUDE.md § Workflow`).
|
|
113
|
+
|
|
114
|
+
This step cannot be skipped, cannot be AI-substituted, and cannot be bypassed via any lane — with one narrow exception: the Trivial-change lane may skip Stage 7 for pure copy/text/translation changes (spot-check still required for any logic change).
|
|
115
|
+
|
|
116
|
+
### 5. Spec and reality stay in sync
|
|
117
|
+
|
|
118
|
+
User-visible behavior changes update the corresponding `docs/features/<name>.md` in the same commit. State-coordination invariants update `docs/features/<name>-implementation.md` in the same commit.
|
|
119
|
+
|
|
120
|
+
Spec-vs-code drift makes the project lie about itself. Drift is caught by `/audit-spec`; correction is mandatory at the commit gate.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Section 2 — Project identity
|
|
125
|
+
|
|
126
|
+
> **Filled at `/init` via 3-5 plain-language questions. Edit via `/constitution-edit`.**
|
|
127
|
+
|
|
128
|
+
**Who do we serve?**
|
|
129
|
+
|
|
130
|
+
使用本工具复习课程的学生(主要是项目作者本人)
|
|
131
|
+
|
|
132
|
+
**What do we deliberately NOT do?**
|
|
133
|
+
|
|
134
|
+
不替代课件本身;不回答课件之外或无依据的问题;不编造课件中不存在的内容
|
|
135
|
+
|
|
136
|
+
**Compliance / legal floors:**
|
|
137
|
+
|
|
138
|
+
none(无合规要求)
|
|
139
|
+
|
|
140
|
+
**Performance floors that cannot be crossed:**
|
|
141
|
+
|
|
142
|
+
暂无正式性能底线
|
|
143
|
+
|
|
144
|
+
**Other "if-violated-it's-not-this-project-anymore" statements:**
|
|
145
|
+
|
|
146
|
+
所有回答必须可追溯到课件来源;课件中查不到时必须如实告知,绝不编造
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Section 3 — Project-specific red lines
|
|
151
|
+
|
|
152
|
+
> **Starts empty. Grows via `/add-constitution-clause`.**
|
|
153
|
+
|
|
154
|
+
A rule should only be promoted to this section if it meets ALL THREE:
|
|
155
|
+
|
|
156
|
+
- **Project-wide scope** (not area-specific — area rules belong in rule sources)
|
|
157
|
+
- **Absolute** (no exceptions, no lane override)
|
|
158
|
+
- **Identity-changing** (violating it makes this no longer this project)
|
|
159
|
+
|
|
160
|
+
Most rules should stay in rule sources or anti-flag rules. Only promote here when the bar above is met.
|
|
161
|
+
|
|
162
|
+
### 1. 双系统 · 双 AI 兼容(Mac/Windows × Claude/Codex)
|
|
163
|
+
|
|
164
|
+
本项目必须始终能在 **macOS 与 Windows** 两种系统上运行,并且必须同时支持 **Claude 与 Codex** 两套 AI harness。用 Claude 运行时,Claude Code CLI 读取 `CLAUDE.md` 即可丝滑运行并输出;用 Codex 运行时,Codex 读取其入口(`AGENTS.md`,并以 `codex.md` 作为指路文件)即可同样丝滑运行。首次架构由 Claude 搭建;此后每完成一个功能,必须同步交付一份 Codex 可无缝启动的等价实现(例如 Claude 的 `.claude/commands/<name>.md` 对应 Codex 的 `.codex/prompts/<name>.md`),不得只交付单一 AI 或单一系统的版本。
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# course/ — 你的科目放这里
|
|
2
|
+
|
|
3
|
+
每个科目一个文件夹,文件夹名建议用课程代码(如 `ECON-10005`)。结构:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
course/
|
|
7
|
+
<课程代码>/
|
|
8
|
+
slide/ ← 课件 PDF(/slide 在这里查知识点)
|
|
9
|
+
exam/ ← 题目文件(/exam 在这里找题、解答)
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`course_code(example)/` 是示例,放了两个示例课件。用法:
|
|
13
|
+
1. 复制这个文件夹,改成你的课程代码;
|
|
14
|
+
2. 把课件 PDF 放进 `slide/`,题目文件放进 `exam/`;
|
|
15
|
+
3. 打开 Claude Code,告诉它科目 + 问题,或用 `/slide` `/exam`。
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
%PDF-1.4
|
|
2
|
+
1 0 obj
|
|
3
|
+
<< /Type /Catalog /Pages 2 0 R >>
|
|
4
|
+
endobj
|
|
5
|
+
2 0 obj
|
|
6
|
+
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
|
|
7
|
+
endobj
|
|
8
|
+
3 0 obj
|
|
9
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>
|
|
10
|
+
endobj
|
|
11
|
+
4 0 obj
|
|
12
|
+
<< /Length 315 >>
|
|
13
|
+
stream
|
|
14
|
+
BT /F1 16 Tf 72 740 Td 20 TL
|
|
15
|
+
(Lecture 1: Example Slide \(Opportunity Cost\)) Tj
|
|
16
|
+
T* () Tj
|
|
17
|
+
T* (Opportunity cost is the value of the next-best) Tj
|
|
18
|
+
T* (alternative you give up when you make a choice.) Tj
|
|
19
|
+
T* () Tj
|
|
20
|
+
T* (This is an EXAMPLE file. Replace it with your real) Tj
|
|
21
|
+
T* (course slides in this slide/ folder.) Tj
|
|
22
|
+
ET
|
|
23
|
+
endstream
|
|
24
|
+
endobj
|
|
25
|
+
5 0 obj
|
|
26
|
+
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
|
|
27
|
+
endobj
|
|
28
|
+
xref
|
|
29
|
+
0 6
|
|
30
|
+
0000000000 65535 f
|
|
31
|
+
0000000009 00000 n
|
|
32
|
+
0000000058 00000 n
|
|
33
|
+
0000000115 00000 n
|
|
34
|
+
0000000241 00000 n
|
|
35
|
+
0000000607 00000 n
|
|
36
|
+
trailer
|
|
37
|
+
<< /Size 6 /Root 1 0 R >>
|
|
38
|
+
startxref
|
|
39
|
+
677
|
|
40
|
+
%%EOF
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
%PDF-1.4
|
|
2
|
+
1 0 obj
|
|
3
|
+
<< /Type /Catalog /Pages 2 0 R >>
|
|
4
|
+
endobj
|
|
5
|
+
2 0 obj
|
|
6
|
+
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
|
|
7
|
+
endobj
|
|
8
|
+
3 0 obj
|
|
9
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>
|
|
10
|
+
endobj
|
|
11
|
+
4 0 obj
|
|
12
|
+
<< /Length 326 >>
|
|
13
|
+
stream
|
|
14
|
+
BT /F1 16 Tf 72 740 Td 20 TL
|
|
15
|
+
(Lecture 2: Example Slide \(Confidence Interval\)) Tj
|
|
16
|
+
T* () Tj
|
|
17
|
+
T* (A 95% confidence interval is a range that would) Tj
|
|
18
|
+
T* (contain the true parameter in 95% of repeated samples.) Tj
|
|
19
|
+
T* () Tj
|
|
20
|
+
T* (This is an EXAMPLE file. Replace it with your real) Tj
|
|
21
|
+
T* (course slides in this slide/ folder.) Tj
|
|
22
|
+
ET
|
|
23
|
+
endstream
|
|
24
|
+
endobj
|
|
25
|
+
5 0 obj
|
|
26
|
+
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
|
|
27
|
+
endobj
|
|
28
|
+
xref
|
|
29
|
+
0 6
|
|
30
|
+
0000000000 65535 f
|
|
31
|
+
0000000009 00000 n
|
|
32
|
+
0000000058 00000 n
|
|
33
|
+
0000000115 00000 n
|
|
34
|
+
0000000241 00000 n
|
|
35
|
+
0000000618 00000 n
|
|
36
|
+
trailer
|
|
37
|
+
<< /Size 6 /Root 1 0 R >>
|
|
38
|
+
startxref
|
|
39
|
+
688
|
|
40
|
+
%%EOF
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# 课件查询 /slide — Implementation Notes
|
|
2
|
+
|
|
3
|
+
**Spec:** docs/features/slide-query.md (canonical, CEO domain)
|
|
4
|
+
**This file:** technical detail, manager domain.
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
`/slide` is implemented in two parallel forms (Constitution §3 red line #1 — every feature ships a Claude version AND a Codex version):
|
|
9
|
+
- **Claude:** a slash command / prompt file at `.claude/commands/slide.md`.
|
|
10
|
+
- **Codex:** a skill at `.codex/skills/slide/SKILL.md`, installed to `~/.codex/skills/slide/` via `.codex/install-skills.sh` (Codex auto-triggers it from the `description`, no `/` syntax).
|
|
11
|
+
|
|
12
|
+
Neither is a separate application. The command/skill instructs the assistant to answer ONLY from the **current subject's** PDF course materials in `course/<subject>/slide/`, with mandatory source citations.
|
|
13
|
+
|
|
14
|
+
No build step, no runtime, no dependencies beyond Claude Code / Codex itself.
|
|
15
|
+
|
|
16
|
+
## Multi-subject architecture (2026-06-10)
|
|
17
|
+
|
|
18
|
+
- Materials live under `course/<subject>/slide/`; problem files under `course/<subject>/exam/` (sibling feature `/exam`). One folder per subject (e.g. `course_code(example)`, `course_code(example)`).
|
|
19
|
+
- **Subject resolution** (same logic in slide + exam, Claude + Codex):
|
|
20
|
+
1. `ls -d course/*/` to enumerate subjects.
|
|
21
|
+
2. Read current session subject from `.harness/state/current-subject.txt` (may not exist).
|
|
22
|
+
3. If the user names a subject → use it and write it to the state file. Else if state has one → reuse. Else if exactly one subject folder → use it (and write state). Else (multiple, none chosen) → **ask the user** and wait. Switching subject overwrites the state file.
|
|
23
|
+
- The state file `.harness/state/current-subject.txt` is runtime/personal — gitignored, not committed.
|
|
24
|
+
|
|
25
|
+
## Not-found behavior (2026-06-10 — "ask before supplementing")
|
|
26
|
+
|
|
27
|
+
Replaces the old "never supplement" red line. When the answer is absent from the current subject's `slide/`: state plainly it is not in the materials, **then ask** whether the user wants an outside (web-search / model-known) supplement, and wait. Only on user consent, supplement with a whole-block label "⚠️ non-courseware, external source, verify yourself" (attach source links if web-searched). Courseware remains the sole primary source; never supplement without consent.
|
|
28
|
+
|
|
29
|
+
## Functional requirements (EARS)
|
|
30
|
+
|
|
31
|
+
- **WHEN** the user invokes `/slide` with a non-empty question **THE SYSTEM SHALL** read the PDF files under the current subject's `course/<subject>/slide/`, locate relevant content, and answer in Chinese with proper nouns kept in English, an original-text excerpt, and a source citation in the form `(第N讲 第M页)`.
|
|
32
|
+
- **WHEN** the answer content is found across multiple PDFs **THE SYSTEM SHALL** synthesize a single coherent answer and attach a separate citation to each contributing part.
|
|
33
|
+
- **WHEN** the question's answer is not present in the current subject's course material **THE SYSTEM SHALL** state plainly that the materials do not contain it, **then ask the user whether to supplement from outside (web/model knowledge), and wait** — supplementing only on consent and only with a whole-block "non-courseware / external / verify yourself" label. It SHALL NOT supplement without consent. *(2026-06-10: relaxes the prior absolute "never supplement" red line into "ask-then-supplement"; courseware stays the sole primary source.)*
|
|
34
|
+
- **WHEN** only related-but-not-direct content exists **THE SYSTEM SHALL** return the related content, label it explicitly as not a direct answer, and cite its source.
|
|
35
|
+
- **WHEN** the current subject's `course/<subject>/slide/` folder contains no readable course material **THE SYSTEM SHALL** tell the user to add materials and SHALL NOT fabricate an answer.
|
|
36
|
+
- **WHEN** a PDF's internal lecture number cannot be determined **THE SYSTEM SHALL** fall back to citing by `文件名 + 页码` and note the lecture number is uncertain.
|
|
37
|
+
- **WHEN** a PDF cannot be read as text (scanned image / encrypted / corrupted) **THE SYSTEM SHALL** name the unreadable file and continue answering from the remaining readable materials.
|
|
38
|
+
- **IF** the user invokes `/slide` with no question **THEN THE SYSTEM SHALL** prompt for a question rather than answering.
|
|
39
|
+
- **WHEN** two or more course materials give conflicting statements about the same question **THE SYSTEM SHALL** present each statement with its own citation, flag the disagreement, and SHALL NOT merge or adjudicate beyond what the materials support.
|
|
40
|
+
- **WHEN** the lecture number or page of a cited fragment cannot be reliably determined **THE SYSTEM SHALL** mark the citation as uncertain rather than presenting a fabricated exact reference.
|
|
41
|
+
- **WHEN** the question is too broad, ambiguous, or relies on missing prior context (stateless follow-up) **THE SYSTEM SHALL** ask the user to restate it concretely rather than guessing intent, optionally returning clearly-labeled related material.
|
|
42
|
+
|
|
43
|
+
## Command / skill files
|
|
44
|
+
|
|
45
|
+
- Claude: `.claude/commands/slide.md`; `$ARGUMENTS` carries `[subject] <question>`.
|
|
46
|
+
- Codex: `.codex/skills/slide/SKILL.md` (installed to `~/.codex/skills/slide/`).
|
|
47
|
+
- Shape: defines subject resolution, the role ("answer ONLY from the current subject's `slide/` PDFs, always cite, never fabricate"), citation format, language rule (Chinese + English proper nouns + original excerpt), and the not-found(ask-then-supplement) / partial-match / unreadable-file behaviors.
|
|
48
|
+
|
|
49
|
+
## PDF reading approach
|
|
50
|
+
|
|
51
|
+
- Source folder: `course/<subject>/slide/`. Claude renders PDFs with the Read tool (`pages` param). Codex has no built-in PDF rendering — it extracts text via `pdftotext -layout` or `pypdf` in shell.
|
|
52
|
+
- Reading: Claude Code's Read tool can render PDF pages. Per-request page limits apply (the tool reads up to ~20 pages/request and requires an explicit page range for large PDFs).
|
|
53
|
+
- ~10 PDFs × 1.5–3.5MB each. Reading all pages of all PDFs for every query is potentially heavy. **Open implementation decision (deferred per spec §6):** whether to read on-demand (let the assistant open relevant PDFs/pages per question) vs. maintain a lightweight index. Start simple: on-demand reading, let the model decide which files/pages to open based on the question. Revisit if latency/cost is a problem.
|
|
54
|
+
|
|
55
|
+
## Citation derivation
|
|
56
|
+
|
|
57
|
+
- Lecture number ("第N讲" / "slide N"): derived by reading the PDF's internal title/header text (CEO choice C). Fallback chain: PDF internal title → filename pattern (if it encodes a number) → "讲次未确定 + 文件名".
|
|
58
|
+
- Page number: from the PDF page where the cited content appears.
|
|
59
|
+
|
|
60
|
+
## Testing strategy (deferred — spec §6)
|
|
61
|
+
|
|
62
|
+
Testing an LLM-driven command is non-traditional. No conventional unit-test framework applies directly. Candidate approach: an **eval-style harness** with a few small fixture PDFs and a question set, asserting:
|
|
63
|
+
1. Found-in-materials questions → answer includes a citation.
|
|
64
|
+
2. Not-in-materials questions → answer says "课件里没有", no fabricated content.
|
|
65
|
+
3. Partial-match questions → answer carries the "非直接回答" label.
|
|
66
|
+
|
|
67
|
+
To be finalized at Stage 4/6. `test_required = true` at project level, but the concrete framework (`test_framework = 待定`) is unresolved.
|
|
68
|
+
|
|
69
|
+
## File locations
|
|
70
|
+
|
|
71
|
+
- `.claude/commands/slide.md` — Claude command definition
|
|
72
|
+
- `.codex/skills/slide/SKILL.md` — Codex skill definition (installed via `.codex/install-skills.sh`)
|
|
73
|
+
- `course/<subject>/slide/` — user's PDF course materials per subject (user-provided, not committed unless user chooses)
|
|
74
|
+
- `.harness/state/current-subject.txt` — current session subject (runtime, gitignored)
|
|
75
|
+
- `docs/features/slide-query.md` — CEO spec
|
|
76
|
+
|
|
77
|
+
## Scenario → automated test map
|
|
78
|
+
|
|
79
|
+
*(Empty stub — fills in at Stage 6.)*
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Feature: 课件查询 /slide
|
|
2
|
+
|
|
3
|
+
## Status: DRAFT 2026-06-09 · 架构更新 2026-06-10(多科目 + 先问再补充)
|
|
4
|
+
|
|
5
|
+
## 0. 架构更新(2026-06-10)
|
|
6
|
+
|
|
7
|
+
本功能从“单一课件文件夹”升级为“多科目”结构:
|
|
8
|
+
|
|
9
|
+
- 课件不再放在根目录的 `课件/`,而是放在 `course/<科目>/slide/`(每个科目一个文件夹)。同级还有 `course/<科目>/exam/` 放题目(见姊妹功能 `/exam`)。
|
|
10
|
+
- 用户先告诉助手是哪个科目;没说且有多个科目时,助手**先问**;只有一个科目时直接用。当前会话科目记在 `.harness/state/current-subject.txt`,除非用户更换,整段会话沿用同一科目。
|
|
11
|
+
- **核心红线放宽(见 3.4 新版)**:课件里找不到时,助手**先如实说“课件里没有”,再问用户要不要用课件外(联网/AI 已知)知识补充**;用户同意才补充,且补充内容整段标注“非课件、来自外部、请自行核对”。课件依然是绝对的一手资料;未经用户同意绝不补充外部知识。
|
|
12
|
+
|
|
13
|
+
下文 1–9 节里凡是写“课件文件夹 / 课件/”的,均指当前科目的 `course/<科目>/slide/`。
|
|
14
|
+
|
|
15
|
+
## 1. What this feature is for
|
|
16
|
+
|
|
17
|
+
给正在复习课程的同学用的一个命令。用户在课程文件夹里启动助手后,先确定科目,再输入 `/slide` 加上自己的问题,助手只翻阅该科目 `course/<科目>/slide/` 里的课程材料来回答,并且每次回答都标明出处(第几讲、第几页)。它的价值在于:复习时能快速从一堆课件里找到答案,而且每个说法都能追溯到原始课件,绝不凭空编造——让用户可以放心地信任答案。课件查不到时,先如实告知再按需补充。
|
|
18
|
+
|
|
19
|
+
## 2. Happy path
|
|
20
|
+
|
|
21
|
+
### 2.1 提一个问题,得到带出处的答案
|
|
22
|
+
|
|
23
|
+
当用户输入 `/slide` 加一个问题(例如“什么是机会成本”),助手会翻阅“课件”文件夹里的课程材料,找到相关内容后用中文回答。回答里:
|
|
24
|
+
|
|
25
|
+
- 专有名词保留英文原词(例如“机会成本(opportunity cost)”)
|
|
26
|
+
- 附上课件里的原文片段,方便用户核对
|
|
27
|
+
- 每个说法后面标注出处,格式形如 `(第9讲 第13页)`
|
|
28
|
+
|
|
29
|
+
### 2.2 跨多个课件融会贯通
|
|
30
|
+
|
|
31
|
+
当一个问题的答案分散在多个课件里时,助手把它们综合成一个连贯的回答,并在每一部分后面分别标注各自的出处。例如:“……(第9讲 第13页)……(第5讲 第21页)”。
|
|
32
|
+
|
|
33
|
+
### 2.3 一次一问
|
|
34
|
+
|
|
35
|
+
每次 `/slide` 处理一个问题。用户想再问,就再输入一次 `/slide` 加新问题。助手不进入“连续问答”状态。
|
|
36
|
+
|
|
37
|
+
## 3. Edge-case behavior
|
|
38
|
+
|
|
39
|
+
### 3.1 问题里没有内容(只输入了 /slide)
|
|
40
|
+
|
|
41
|
+
#### Behavior (CEO sign-off)
|
|
42
|
+
- 当用户只输入 `/slide`、后面没有跟问题
|
|
43
|
+
- 助手不乱猜,而是提示用户“请在 /slide 后面写上你想问的问题”
|
|
44
|
+
- 用户看到一句友好的提示
|
|
45
|
+
|
|
46
|
+
#### Classification
|
|
47
|
+
[Smoke test only]
|
|
48
|
+
|
|
49
|
+
#### Smoke test procedure
|
|
50
|
+
**Reproduce:** 输入 `/slide`,不带任何问题。
|
|
51
|
+
**Pass criteria:** 助手提示需要补充问题,没有瞎编答案。
|
|
52
|
+
**Failure signals:** 助手凭空给出一个不存在的问题的答案。
|
|
53
|
+
|
|
54
|
+
### 3.2 课件文件夹是空的 / 里面没有可用课件
|
|
55
|
+
|
|
56
|
+
#### Behavior (CEO sign-off)
|
|
57
|
+
- 当“课件”文件夹里没有任何课程材料
|
|
58
|
+
- 助手如实告知“课件文件夹里还没有课件,请先把课件放进去”
|
|
59
|
+
- 不编造任何答案
|
|
60
|
+
|
|
61
|
+
#### Classification
|
|
62
|
+
[Required automated test]
|
|
63
|
+
|
|
64
|
+
#### Smoke test procedure
|
|
65
|
+
**Reproduce:** 清空课件文件夹,输入 `/slide 任意问题`。
|
|
66
|
+
**Pass criteria:** 助手提示没有课件,不给出任何虚构答案。
|
|
67
|
+
**Failure signals:** 助手在没有课件的情况下仍然“回答”了问题。
|
|
68
|
+
|
|
69
|
+
### 3.3 答案在课件里能找到
|
|
70
|
+
|
|
71
|
+
#### Behavior (CEO sign-off)
|
|
72
|
+
- 当问题的答案确实在某个课件里
|
|
73
|
+
- 助手用中文回答,保留专有名词英文,附课件原文片段,并标注出处(第几讲第几页)
|
|
74
|
+
- 用户看到答案 + 可核对的原文 + 出处
|
|
75
|
+
|
|
76
|
+
#### Classification
|
|
77
|
+
[Required automated test]
|
|
78
|
+
|
|
79
|
+
### 3.4 答案在课件里找不到(核心红线 · 2026-06-10 改为“先问再补充”)
|
|
80
|
+
|
|
81
|
+
#### Behavior (CEO sign-off)
|
|
82
|
+
- 当问题的答案在当前科目所有课件里都找不到
|
|
83
|
+
- 助手**先**明确说明“课件里没有这个内容”,**绝不在用户同意前编造或擅自用课件外知识补充**
|
|
84
|
+
- 然后助手**问用户**:“要不要我用课件之外的知识(联网搜索 / 我已知的知识)补充一下?”——停下来等用户回答
|
|
85
|
+
- **只有用户同意后**才补充;补充内容整段标注“⚠️ 非课件内容、来自外部,请自行核对”(联网搜到的附来源链接)。用户不要补充则到此为止
|
|
86
|
+
- 如果同时有课件读不出来(见 3.8),措辞要收紧为“在**能读取的**课件里没找到;文件 xxx 没读出来、未纳入判断”,不把它说成绝对的“全部课件里都没有”
|
|
87
|
+
- 用户先看到诚实的“未找到”,再自主决定是否要外部补充——绝不会拿到一个看似来自课件其实没依据的答案
|
|
88
|
+
|
|
89
|
+
#### Classification
|
|
90
|
+
[Required automated test]
|
|
91
|
+
|
|
92
|
+
### 3.5 课件里只有“相关但不完全对应”的内容
|
|
93
|
+
|
|
94
|
+
#### Behavior (CEO sign-off)
|
|
95
|
+
- 当课件里没有问题的直接答案,但有相关内容
|
|
96
|
+
- 助手把相关内容给出来,并明确标注“这是相关内容,课件里没有直接回答你这个问题”,同时给出出处
|
|
97
|
+
- 用户能区分“直接答案”和“仅供参考的相关内容”
|
|
98
|
+
|
|
99
|
+
#### Classification
|
|
100
|
+
[Required automated test]
|
|
101
|
+
|
|
102
|
+
### 3.6 出处的讲次或页码无法确定
|
|
103
|
+
|
|
104
|
+
#### Behavior (CEO sign-off)
|
|
105
|
+
- 当某个课件内部没有写清楚是第几讲,或某段内容对应的页码无法确定
|
|
106
|
+
- 助手退回用“文件名 + 页码”来标注出处;若连页码也没把握,就明确标注“出处不确定”,绝不假装精确
|
|
107
|
+
- 用户仍然能定位到具体文件,并清楚哪些出处是确定的、哪些是不确定的
|
|
108
|
+
|
|
109
|
+
#### Classification
|
|
110
|
+
[Smoke test only]
|
|
111
|
+
|
|
112
|
+
#### Smoke test procedure
|
|
113
|
+
**Reproduce:** 放入一个内部没有讲次编号的课件,提一个答案在其中的问题。
|
|
114
|
+
**Pass criteria:** 助手用文件名+页码标注;讲次或页码没把握时明确说“不确定”,不凭空编一个精确编号。
|
|
115
|
+
**Failure signals:** 助手凭空编一个讲次或页码编号,并把它当成精确出处呈现。
|
|
116
|
+
|
|
117
|
+
### 3.7 问的是和课程无关的问题
|
|
118
|
+
|
|
119
|
+
#### Behavior (CEO sign-off)
|
|
120
|
+
- 当用户问的内容和课程课件无关
|
|
121
|
+
- 助手按“课件里没有”处理,如实说明
|
|
122
|
+
- 不用课程之外的常识去回答
|
|
123
|
+
|
|
124
|
+
#### Classification
|
|
125
|
+
[Smoke test only]
|
|
126
|
+
|
|
127
|
+
#### Smoke test procedure
|
|
128
|
+
**Reproduce:** 输入一个明显与课程无关的问题(例如“今天天气怎么样”)。
|
|
129
|
+
**Pass criteria:** 助手说明这不在课件范围内,不作答。
|
|
130
|
+
**Failure signals:** 助手当成普通聊天回答了。
|
|
131
|
+
|
|
132
|
+
### 3.8 某个课件读不出来(例如是扫描图片、无法提取文字)
|
|
133
|
+
|
|
134
|
+
#### Behavior (CEO sign-off)
|
|
135
|
+
- 当某个课件文件无法读取出文字内容
|
|
136
|
+
- 助手告知用户“某个文件读不出文字内容(文件名:xxx)”,并基于其余能读的课件继续回答
|
|
137
|
+
- 用户知道哪个文件没被纳入
|
|
138
|
+
|
|
139
|
+
#### Classification
|
|
140
|
+
[Smoke test only]
|
|
141
|
+
|
|
142
|
+
#### Smoke test procedure
|
|
143
|
+
**Reproduce:** 放入一个扫描版(纯图片)PDF,提一个其内容相关的问题。
|
|
144
|
+
**Pass criteria:** 助手指出该文件读不出文字,不假装读到了。
|
|
145
|
+
**Failure signals:** 助手编造该文件的内容。
|
|
146
|
+
|
|
147
|
+
### 3.9 多个课件内容互相矛盾
|
|
148
|
+
|
|
149
|
+
#### Behavior (CEO sign-off)
|
|
150
|
+
- 当不同课件对同一问题给出不一致的说法
|
|
151
|
+
- 助手**不替用户裁决、不强行合并成一个答案**,而是分别如实列出每份课件的说法和各自出处,并指出“这两处课件说法不一致”
|
|
152
|
+
- 用户看到双方原始说法 + 出处,自己判断
|
|
153
|
+
|
|
154
|
+
#### Classification
|
|
155
|
+
[Required automated test]
|
|
156
|
+
|
|
157
|
+
### 3.10 问题太宽泛、模糊、或缺上下文(含追问类)
|
|
158
|
+
|
|
159
|
+
#### Behavior (CEO sign-off)
|
|
160
|
+
- 当问题太笼统、含义不清,或是依赖上文的追问(例如“上一个概念有什么例子”——但每次 `/slide` 不记得上文)
|
|
161
|
+
- 助手**不猜测用户到底想问什么**,而是请用户把问题说完整(例如把“上一个概念”换成具体名词)
|
|
162
|
+
- 在能给出明确标注的相关内容时,可一并给出,但要标注“这是相关内容、非直接回答”
|
|
163
|
+
- 用户得到的是“请说清楚”的引导,而不是一个基于猜测的答案
|
|
164
|
+
|
|
165
|
+
#### Classification
|
|
166
|
+
[Smoke test only]
|
|
167
|
+
|
|
168
|
+
#### Smoke test procedure
|
|
169
|
+
**Reproduce:** 输入一个模糊或缺上下文的问题,例如 `/slide 这个怎么算`。
|
|
170
|
+
**Pass criteria:** 助手请用户补充清楚,而不是猜一个具体问题来回答。
|
|
171
|
+
**Failure signals:** 助手自行假设用户想问什么并直接作答。
|
|
172
|
+
|
|
173
|
+
## 4. Who can use this
|
|
174
|
+
|
|
175
|
+
- 任何在本课程文件夹里运行助手的人(本地使用,无需登录)
|
|
176
|
+
- 前提是“课件”文件夹里已放入课程材料
|
|
177
|
+
- 没有课件时,功能会提示先放入课件
|
|
178
|
+
|
|
179
|
+
## 5. External dependencies (plain language)
|
|
180
|
+
|
|
181
|
+
- 依赖助手本身读取 PDF 文件的能力
|
|
182
|
+
- 当某个 PDF 是扫描图片、加密、或损坏而读不出文字时:按 3.8 处理,告知用户该文件无法读取,用其余课件继续回答
|
|
183
|
+
|
|
184
|
+
## 6. Deferred / unresolved
|
|
185
|
+
|
|
186
|
+
- **自动化测试方式待定**:这个功能本质是“让助手按规则回答”,怎么自动化地验证“引用准确、找不到时如实说”需要在实现阶段确定测试做法(可能以少量样例课件做评测式测试为主)。已记录,留到实现阶段解决。
|
|
187
|
+
- 课件较多/较大时,一次能否全部读入、是否需要分批,留到实现阶段评估(属技术细节)。
|
|
188
|
+
|
|
189
|
+
## 7. Out of scope
|
|
190
|
+
|
|
191
|
+
- 题目问答(`/exam`)——已作为姊妹功能落地(在 `course/<科目>/exam/` 里找题目并解答),规则见 `.claude/commands/exam.md` / `.codex/skills/exam/SKILL.md`
|
|
192
|
+
- 未经用户同意,回答课件范围之外的任何内容
|
|
193
|
+
- 修改、整理或总结课件本身(只做查询问答)
|
|
194
|
+
|
|
195
|
+
## 8. Decision history
|
|
196
|
+
|
|
197
|
+
- 2026-06-09 CEO:采用“一次一问”形式(`/slide 问题`),不做持续问答模式。
|
|
198
|
+
- 2026-06-09 CEO:每次回答必须标注出处(第几讲第几页),并支持跨多个课件综合回答。
|
|
199
|
+
- 2026-06-09 CEO:出处的讲次通过读取 PDF 内部标题/内容判断;无法判断时退回文件名+页码并说明不确定。
|
|
200
|
+
- 2026-06-09 CEO:回答用中文,保留专有名词英文原词,并附课件原文片段供核对。
|
|
201
|
+
- 2026-06-09 CEO:课件里只有相关内容时,给出相关内容并明确标注“非直接回答”。
|
|
202
|
+
- 2026-06-09 CEO:核心红线——课件里找不到就如实说“没有”,绝不编造、绝不用课件外知识补充。
|
|
203
|
+
- 2026-06-09 CEO(采纳 Codex 审计):课件之间说法矛盾时,分别列出各自说法和出处,不替用户裁决、不强行合并(见 3.9)。
|
|
204
|
+
- 2026-06-09 CEO(采纳 Codex 审计):出处的讲次或页码没把握时,明确标注“不确定”,不假装精确(见 3.6)。
|
|
205
|
+
- 2026-06-09 CEO(采纳 Codex 审计):问题模糊或缺上下文(含追问类)时,请用户说清楚,不猜测意图(见 3.10)。
|
|
206
|
+
- 2026-06-10 CEO:项目改名 CCC-tutor,升级为多科目架构——课件放 `course/<科目>/slide/`、题目放 `course/<科目>/exam/`;用户先定科目,没说且多科目时先问,单科目直接用,会话内沿用(记于 `.harness/state/current-subject.txt`)。
|
|
207
|
+
- 2026-06-10 CEO:核心红线放宽——课件查不到时不再“绝不补充”,而是“先如实说没有、再问用户、用户同意后才用外部知识补充并整段标注非课件来源”(见 3.4 新版)。
|
|
208
|
+
- 2026-06-10 CEO:新增姊妹功能 `/exam`——在 `course/<科目>/exam/` 里定位指定文件中的指定题目并解答,解题依据优先引用同科目 slide 课件并标出处。
|
|
209
|
+
|
|
210
|
+
## 9. (Audit mode only — leave empty in new-feature mode) Code vs spec delta
|
|
211
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Framework Meta-Docs (`outcome/docs-harness/`)
|
|
2
|
+
|
|
3
|
+
This directory holds the harness's **own design docs** — not project-feature docs (those live at `{{spec_dir}}`), and not operational rules (those live in `CLAUDE.md` / `AGENTS.md`). The files here explain **why** the harness is designed the way it is, and how to adopt it.
|
|
4
|
+
|
|
5
|
+
## What's in here
|
|
6
|
+
|
|
7
|
+
| File | Purpose | When to read |
|
|
8
|
+
|------|---------|--------------|
|
|
9
|
+
| `design-spec.md` | Architectural rationale — the WHY behind the operating model, cross-model audit, two-file spec, lanes, etc. | Onboarding; before extending the harness |
|
|
10
|
+
| `adoption-playbook.md` | Step-by-step guide for installing the harness in a new or existing project | When `/init` is too narrow and you want the full playbook |
|
|
11
|
+
| `retrospective-notes.md` | Generalized lessons from real-world use (LLM-workflow patterns, sweep methodology, when to delete vs fix) | Periodically; before non-trivial feature work |
|
|
12
|
+
| `context-architecture-v2.md` | 3-tier memory layout (working / recall / archival), AI calling rules, snapshot schema, trigger surfaces | Before touching `memory-*.sh`, `scratchpad-*.sh`, `/handoff`, `/recall`, or `/offload` |
|
|
13
|
+
|
|
14
|
+
## What was removed from the original
|
|
15
|
+
|
|
16
|
+
The original harness shipped 5 files in this directory totaling 3382 lines. Two were **deleted entirely** in the generic harness:
|
|
17
|
+
|
|
18
|
+
- **`current-state.md` (1113 lines)** — A snapshot of the *original* project's harness state at one point in time. Becomes obsolete the moment the harness moves forward. For the generic harness, current state is read from the code, not from a doc that drifts. Use `/audit-spec` to produce a fresh as-built reading whenever needed.
|
|
19
|
+
|
|
20
|
+
- **`double-check.md` (98 lines)** — A checklist of project-specific pitfalls. 95% duplicated content already in `design-spec.md § Scenario classification` and similar sections, and the remaining 5% was tightly coupled to one project's file paths.
|
|
21
|
+
|
|
22
|
+
The other three files were **kept and generalized** — project-specific examples replaced with abstract pattern descriptions, project terminology replaced with the harness's standard vocabulary, and Korean shorthand translated to English to match the rest of the harness.
|
|
23
|
+
|
|
24
|
+
## Reading order
|
|
25
|
+
|
|
26
|
+
If you're new to the harness:
|
|
27
|
+
|
|
28
|
+
1. **Constitution** (`outcome/constitution.md`) — read first; the universal-core invariants and project identity.
|
|
29
|
+
2. **CLAUDE.md** (`outcome/CLAUDE.md`) — the operating manual for day-to-day work.
|
|
30
|
+
3. **`design-spec.md`** (this directory) — the architectural rationale behind both files above.
|
|
31
|
+
4. **`adoption-playbook.md`** — when ready to install the harness in a project.
|
|
32
|
+
5. **`retrospective-notes.md`** — once you've shipped your first feature through the harness.
|
|
33
|
+
|
|
34
|
+
If you're extending the harness:
|
|
35
|
+
|
|
36
|
+
1. **`design-spec.md`** — to understand the load-bearing invariants you can't break.
|
|
37
|
+
2. **`outcome/agents/README.md`** — for the plugin pattern.
|
|
38
|
+
3. **`outcome/skills/<skill>/SKILL.md`** — for examples of how a skill is shaped.
|
|
39
|
+
|
|
40
|
+
## Why this directory exists at all
|
|
41
|
+
|
|
42
|
+
The harness's design has nontrivial structure (CEO/manager domain split, cross-model audit invariant, scenario-ID-to-test mapping, lane classification, etc.). Without a single document explaining the **why**, the structure looks arbitrary — and a contributor (human or AI) who doesn't understand the rationale will rationalize past invariants that exist for non-obvious reasons. `design-spec.md` is that document.
|