Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ Read these references as needed:
- [Rhetorical move registry](references/rhetorical-moves.md)
- [Writing failure taxonomy](references/writing-failure-taxonomy.md)
- [Internal register gate](references/internal-register-gate.md)
- [Skill repository maintenance](references/skill-repository-maintenance.md)
- [Self-narration and config dump](references/self-narration-and-config-dump.md)
- [Artifact register to scientific register](references/artifact-register-to-scientific-register.md)
- [AI pattern taxonomy](references/ai-pattern-taxonomy.md)
Expand Down
31 changes: 31 additions & 0 deletions references/internal-register-gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,37 @@ The general rule these share: **severity follows what the reader can reach.** A
public repository path is reachable and belongs in a data statement; a path on
one machine, a chat turn, and a placeholder are unreachable and block.

### Bilingual symmetry is part of the gate, not an extension of it

The class inventory above was built from Vietnamese examples. Run against English
prose carrying all ten defects, it reported **7 of 10** and a clean threshold table:
`progress_state_limitation`, `verification_log_prose`, and
`defensive_disclaimer_stack` had no English markers at all. Nothing in the output
announced that English was unchecked — the gate simply passed.

Every class therefore needs markers in both languages, a fixture in both languages,
and a test asserting the same class set on both. The English markers that were
missing:

| Class | English markers |
| --- | --- |
| `progress_state_limitation` | *has/have not yet been completed / validated / annotated*, *will be added later*, *is still in progress / underway / pending* |
| `verification_log_prose` | *we checked / verified / confirmed / reran / compiled*, *the checksum matched*, *zero errors*, *no errors were found*, *passed all checks* |
| `defensive_disclaimer_stack` | *do/does not prove / guarantee / imply / establish*, *cannot guarantee*, *only establish(es) / show(s) / reflect(s) / applies to* |

Two traps in the denial stack specifically:

- **Person agreement.** The first pattern carried only `does not prove`, so a genuine
three-sentence stack containing `They do not prove Y` counted two markers and stayed
under threshold. The class appeared absent rather than under-detected.
- **`not only … but also` must be excluded exactly as `không chỉ … mà còn` is.** It is
an intensifier; without the exclusion an emphatic Discussion paragraph is graded as
self-defence.

When a marker does not fire, print the matcher's output sentence by sentence before
editing the pattern. Guessing at the regex cost two revisions; one diagnostic print
located the cause immediately.

## 8. Read mode: auditing a text you did not write

Report; do not rewrite. For each finding give the span, the class, the failing
Expand Down
82 changes: 82 additions & 0 deletions references/skill-repository-maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Skill Repository Maintenance

This skill is normally deployed in two places with different roles, and editing one
without the other is the usual cause of lost work.

| Location | Role |
| --- | --- |
| the runtime skills tree, wherever the host agent loads skills from | what the agent actually reads; edited first, because that is where a lesson is discovered |
| this repository | the published source; it alone owns `README.md`, `evals/`, `tests/`, `scripts/validate_skill.py`, and the CI workflow |

## 1. Never copy one-way

A recursive copy from runtime to repository is this skill's own
`generated_artifact_drift` failure applied to itself: everything that exists only at
the destination is destroyed, and the rebuilt file carries no record that it existed.

Measured loss from one such copy: the `## Learning From Feedback` heading. The
paragraph survived; the heading did not, so the section stopped being addressable by
this repository's own contract test. A diff would have shown it in one line.

Protocol:

1. Compare both trees recursively. Enumerate destination-only files **and**
destination-only lines inside shared files.
2. Copy only the files that changed, then re-check that the destination-only lines
survived.
3. Treat structural moves and heading changes as first-class diffs; a naive read
loses them.

## 2. Adding a mechanism means extending the gate

A new reference document, detector, or threshold is not integrated until this
repository's validator can fail because of it. The sequence that works:

1. Add the paths to the `REQUIRED` tuple in `scripts/validate_skill.py` **and** to
`tests/test_repository.py`, fixtures included.
2. Make the validator *invoke* the new test as a subprocess and fail on a non-zero
return code or on `FAILED`/`ERROR` in its output. A required-file check proves the
file exists, not that it works.
3. Add an explicit CI step so the gate is visible in the workflow log.
4. Assert from the contract test that new blocking codes appear in
`references/quality-rubric.md`, so a code can never be enforced by a script while
absent from the published rubric.

## 3. Prove the gate can go red

The convention here is that every check is mutated on purpose to show it knows how to
fail. Apply it to any new gate: delete one branch of the detector, run the validator,
confirm a non-zero exit and which tests failed, restore, confirm green.

A check that has never been observed red is not evidence. This is the same standard
the manuscript-facing rules impose on a verification claim: state the property the
check establishes and, separately, the property it does not.

## 4. Pitfalls found while doing this

- **Run the scanner tests from inside `scripts/`.** They import the scanner as a
sibling module, so invoking them from the repository root raises
`ModuleNotFoundError`. In CI use `working-directory: scripts`; for an ad-hoc
diagnostic, load the module by absolute path.
- **When a marker does not fire, print the matcher's output sentence by sentence**
before editing the pattern. Two regex revisions were spent guessing at the wrong
clause; one diagnostic print located a missing person agreement (`do not` against
`does not`) immediately.
- **Calibrate on real manuscripts, not only on fixtures.** A detector tuned on its own
examples measures nothing. Running it across several genuine drafts produced three
false positives that fixtures never would have: a correlative intensifier, a LaTeX
preamble read as prose, and a repository filename graded as severely as a path on
the author's machine.
- **Keep those calibration cases as permanent tests.** They are the only thing
preventing the same false positive from returning at the next pattern edit.

## 5. Publishing

Branch, commit, push, open a pull request, wait for CI, then merge. The history here
is pull-request based, and a direct push to the default branch breaks that. Scan the
staged diff for secrets before committing: the fixtures deliberately contain
path-shaped and commit-hash-shaped strings, which are synthetic test data rather than
credentials and should be recognized as such rather than removed.

Bump the version in the `SKILL.md` frontmatter, then reconcile the runtime copy so the
two locations do not drift apart again.
1 change: 1 addition & 0 deletions scripts/validate_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"references/writing-failure-taxonomy.md",
"references/terminology-localization.md",
"references/internal-register-gate.md",
"references/skill-repository-maintenance.md",
"references/self-narration-and-config-dump.md",
"references/artifact-register-to-scientific-register.md",
"schemas/audit-record.schema.json",
Expand Down
1 change: 1 addition & 0 deletions tests/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def test_required_files_exist(self) -> None:
"references/pdf-translate-integration.md",
"references/terminology-localization.md",
"references/internal-register-gate.md",
"references/skill-repository-maintenance.md",
"references/self-narration-and-config-dump.md",
"references/artifact-register-to-scientific-register.md",
"schemas/audit-record.schema.json",
Expand Down
Loading