Skip to content

relationship: privacy screening and consent gates; work: non-IT role coverage - #136

Open
SCM-Consultant-Ayaan wants to merge 3 commits into
titanwings:dot-skillfrom
SCM-Consultant-Ayaan:relationship-privacy-gates
Open

relationship: privacy screening and consent gates; work: non-IT role coverage#136
SCM-Consultant-Ayaan wants to merge 3 commits into
titanwings:dot-skillfrom
SCM-Consultant-Ayaan:relationship-privacy-gates

Conversation

@SCM-Consultant-Ayaan

@SCM-Consultant-Ayaan SCM-Consultant-Ayaan commented Aug 18, 2026

Copy link
Copy Markdown

Summary / 摘要
Two related improvements to the distillation pipeline: consent gating plus a privacy screener for the relationship preset, and role coverage for the work track so it stops assuming every subject is an IT worker. Both operationalize governance and quality points the technical report leaves as open work.
为蒸馏流程补了两块:relationship 家族的同意关卡与隐私筛查工具,以及 work 轨道的职位覆盖(不再默认对象是 IT 从业者)。两者都把技术报告中留作 open work 的治理与质量要求落到可执行的代码。
Changes / 变更

  1. relationship — privacy screening + explicit consent gates
    New tools/privacy_screen.py (655 lines). Scans collected raw material under knowledge/{slug}/ before it reaches the analyzers and writes a structured privacy_report.json with an overall CLEAR / NEEDS_REVIEW status.
    Detects phone numbers, emails, Korean RRNs and Chinese national IDs (both checksum-validated), bank accounts (keyword-gated to avoid firing on order numbers), addresses, and Luhn-valid card numbers.
    Flags third-party speakers — participants other than the target and the user — since personal chat exports routinely carry other people's messages.
    Flags sensitive categories: health, sexual content, minors, financial, political/religious.
    Never drops or rewrites source material. Identifier values are masked in the report; third-party display names are shown in the clear so the user can tell who they are being asked about.
    Emits an explicit "not covered by this screen" list on every run, so a CLEAR status is not read as a guarantee.
    SKILL.md — new screening step between source import (Step 2) and analysis (Step 3) for the relationship flow. Analysis cannot start while the status is NEEDS_REVIEW and unresolved; the user decides keep / redact / exclude per flagged category.
    SKILL.md — separate, explicit confirmation gates before writing files, before host installation, and before any gallery publication. Gallery publication is its own gate rather than being implied by the write-files answer. Silence is not treated as consent.
    prompts/relationship/* — correction handling now shows the concrete patch and waits for approval instead of auto-applying to persona.md.
    KakaoTalk export support in the speaker detector: the desktop format (2024년 1월 2일 오후 3:15, 이름 : …) and the bracketed format ([이름] [오후 3:20] …) previously matched no speaker pattern at all, so the most common Korean chat export silently reported zero third parties.
  2. work track — non-IT role coverage
    prompts/work_analyzer.md — role-specific extraction previously covered six IT roles only (backend, frontend, ML, PM, designer, data analyst). Anyone outside that list fell through to the four generic dimensions. Added:
    A rule for roles absent from the list: derive the subject's 3–5 recurring work types, then extract decision criteria, action order, exceptions, escalation thresholds, and red lines. Those four hold for any profession and beat borrowing mismatched IT dimensions.
    A supply-chain / SCM profile covering forecasting (baseline method, manual-override conditions, accuracy tolerances), inventory trade-offs (stockout vs obsolescence preference, safety-stock logic), sourcing (supplier tiering, concession order across price / payment terms / MOQ / lead time, delay escalation thresholds), logistics, exception handling, and S&OP.
    A consulting / professional-services profile covering diagnosis order, deliverable standards, and client communication boundaries.
    prompts/work_builder.md — the render template hardcoded 技术栈 / 代码风格 / 接口设计 / Code Review headings, which produce empty or nonsensical sections for non-engineering subjects. Headings are now role-adaptive, the builder is told to delete inapplicable ones rather than leave shells, and the concreteness examples cover SCM and consulting alongside engineering.
  3. Output language fix
    prompts/work_analyzer.md and prompts/persona_analyzer.md both hardcoded 语言:中文, so a Korean or English user received Chinese analysis regardless of the language they used. Both now follow the user's language, which is what SKILL.md already requires for meta.classification.language.
    Scope note: no changes to the colleague or celebrity flows beyond the shared work_* prompts and the two analyzer language lines described above.
    Motivation / 动机
    Section 9 of the technical report states that responsible deployment "requires explicit participation, scoped source collection, access controls, retention limits, and non-mandatory use," and that gallery publication should stay opt-in with review. The relationship preset is the family where those requirements bite hardest — its evidence is private interpersonal history, and Section 4.4 already frames deletion, correction, and non-public defaults as first-order artifact requirements. Before this change those properties existed as prose in the prompt rather than as steps that block progress, and nothing inspected the collected material for third parties or identifiers at all. This PR turns them into gates the flow cannot skip.
    The work track change addresses a narrower gap. The report presents the colleague setting as the primary and most controllable case, with review checklists and escalation thresholds as the useful payload. That payload is exactly what the analyzer failed to elicit outside software roles: for an SCM planner or a consultant, the questions that matter (what triggers an escalation, which concession comes first, what gets overridden) were never asked, and the render template then labelled their output with engineering headings.
    No linked issue — happy to open one first if maintainers prefer that order.
    Testing / 测试
    [x] python -m unittest discover -s tests -p 'test_*.py' passed — 61 tests, OK (26 pre-existing, 35 new in tests/test_privacy_screen.py)
    [x] python -m compileall tools/ passed
    [x] Manually tested: ran privacy_screen.py against synthetic KakaoTalk exports in both desktop and bracketed formats, confirming third-party speakers are detected with message counts, phone numbers are masked in output, and the limitations list is printed. Also confirmed a clean transcript reports CLEAR.
    New tests cover each detector category, the masking guarantee (asserting raw RRN / card / email values never appear in the report), CLEAR vs NEEDS_REVIEW status, both KakaoTalk formats, the comma-separated timestamp case, and false-positive guards (bare 6-digit codes are not RRNs, order numbers are not bank accounts, Note: prose is not a speaker, a single-line label is not a speaker).
    No new runtime dependencies — privacy_screen.py uses only the standard library.
    Checklist / 检查清单
    [x] I read CONTRIBUTING.md
    [x] Docs updated if behavior or usage changed (README / SKILL.md / INSTALL.md) — SKILL.md updated in both the Chinese and # English Version halves; README.md and docs/lang/README_ZH.md note the new screening gate and its limitations
    [x] No secrets, tokens, or personal data committed — test fixtures are synthetic values generated to satisfy each checksum
    [x] New dependencies added to requirements.txt (if any) — none needed
    [x] Tests added/updated for new functionality
    Notes for reviewers
    Happy to split this. The two concerns are independent: privacy gating for relationship (commits 1–2) and role coverage for the work track (commit 3). If you would rather review or merge them separately, say so and I will open two PRs.
    The one deliberate asymmetry worth scrutinizing: identifier values are masked in privacy_report.json, but third-party display names are not. Masking a two-character Korean name yields **, which makes the "should this person's messages be excluded?" question unanswerable. The name already sits in the source file beside the report, and the report never leaves the machine, so this trades no new exposure for a usable gate — but it is a judgment call, and the reasoning is recorded in the code and in the report's limitations list.
    Detection is pattern-based and deliberately conservative. It will miss paraphrased sensitive topics, third parties mentioned only inside message bodies, and anything in images or audio. The screener says so on every run rather than implying completeness.

dh.shin and others added 3 commits August 18, 2026 05:08
The relationship preset is the most privacy-sensitive family: its source
material is private conversation, which routinely carries third-party
messages, ID numbers, contact details, and sensitive topics. Until now the
flow asked the user for confirmation exactly once, before writing files, and
nothing inspected the collected material before it reached the analyzers.

Add tools/privacy_screen.py, which scans knowledge/{slug}/ and reports:

  - identity-grade identifiers (Korean RRN, PRC resident ID, payment cards),
    each verified against its own checksum so ordinary digit runs do not match
  - contact details (phone, email) and bank accounts, the latter only when a
    banking keyword sits next to the digits
  - third-party speakers, decided by recurring chat-export speaker labels
  - sensitive topics (health, sexual, minors, financial, affiliation)

The screen never edits, redacts, or deletes source files. It writes a
structured privacy_report.json with masked previews only, reports CLEAR or
NEEDS_REVIEW, and prints the categories it does not cover so a CLEAR result
is not read as a guarantee.

Wire it into SKILL.md as Step 2.5 for relationship, blocking analysis while a
NEEDS_REVIEW screen is unresolved, and add explicit gates elsewhere in the
relationship flow: separate consent for writing to disk, installing into a
host, and publishing to the gallery; per-correction approval before a
persona.md change is applied; and a re-screen when new material is appended.

Both language halves of SKILL.md are updated. colleague and celebrity flows
are untouched.

Tests: 58 passed (35 existing, 23 new in tests/test_privacy_screen.py),
covering each detector, checksum validators, masking (asserting raw values
never reach the report), CLEAR/NEEDS_REVIEW status, and false-positive guards.

Co-Authored-By: Claude <noreply@anthropic.com>
Testing the screen against real export formats turned up two problems.

KakaoTalk exports were not recognised at all for third-party detection. Both
the desktop format ("2024년 1월 2일 오후 3:15, 민준 : ...") and the bracketed
format ("[민준] [오후 3:20] ...") fell through every speaker pattern, so the
most common Korean chat export silently reported no third parties. Add both
patterns, allow a comma between an ISO timestamp and the name, and strip
separator punctuation the prefix leaves attached to the label.

Third-party speaker names were also masked, which made the gate unusable: a
two-character Korean name masks to "**", so the user could not tell who they
were being asked about. Report speaker names in the clear and explain why in
both the code and the limitations list. A chat display name is not an
identifier value the report would otherwise be leaking — it sits in the source
file right next to the report, which never leaves the machine. Identifier
values (IDs, cards, phones, emails) stay masked as before.

Tests: 61 passed (3 new, covering both KakaoTalk formats and the comma case).
The work track only had role-specific extraction for six IT roles (backend,
frontend, ML, PM, designer, data analyst). Anyone outside that list fell
through to the four generic dimensions, and work_builder then rendered them
into a template hardcoded with 技术栈 / 代码风格 / 接口设计 / Code Review
headings that do not apply.

Three changes:

- work_analyzer: add a rule for roles absent from the list. Rather than
  skipping the section or borrowing IT dimensions, derive the person's 3-5
  recurring work types and extract decision criteria, action order, exceptions,
  escalation thresholds, and red lines. Those four hold for any profession.

- work_analyzer: add SCM/supply-chain and consulting profiles. SCM covers
  forecasting, inventory trade-offs, supplier and sourcing decisions, logistics,
  exception escalation, and S&OP. Consulting covers diagnosis order,
  deliverable standards, and client communication boundaries.

- work_builder: make section headings role-adaptive instead of IT-only, and
  instruct the builder to drop headings that do not apply rather than leaving
  empty shells. The concreteness examples now cover SCM and consulting too.

Also: work_analyzer and persona_analyzer both hardcoded 语言:中文, so a Korean
or English user got Chinese analysis regardless of the language they used.
Both now follow the user's language, matching what SKILL.md already requires
for meta classification.language.

Tests: 61 passed (unchanged; these are prompt files).
@SCM-Consultant-Ayaan SCM-Consultant-Ayaan changed the title relationship: add privacy screening gate and explicit consent gates relationship: privacy screening and consent gates; work: non-IT role coverage Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant