mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-10-29 03:34:44 +08:00
Prefer positive tutorial prose
This commit is contained in:
@@ -23,6 +23,10 @@ Treat the scene as a teaching device, not a license to write fiction. Do not inv
|
||||
|
||||
Use oral English, familiar words, and connected sentences. Write natural Chinese independently from the same facts. Chinese punctuation should be restrained: prefer one or two connected sentences that carry one technical thought over a row of short, period-heavy statements. Prefer causal explanation over inventories. A paragraph should tell the reader what happens, why it happens, and what that enables.
|
||||
|
||||
Prefer positive, concrete statements throughout the tutorial. Explain what the hook, program, loader, command, or test does and which scope it covers. Rewrite `not`, `do not`, `cannot`, `will not`, `不要`, `不能`, `不会`, `并非`, and `别` whenever the same fact has an accurate positive form, and remove every double negative. Keep at most one compact boundary paragraph near the end, limited to two sentences, instead of distributing failure, limitation, and safety warnings through the article.
|
||||
|
||||
Keep the actor close to the action. Start important sentences with a concrete component, use active voice when ownership matters, connect short facts through cause and effect, and give `this`, `it`, `这` and `它` an unmistakable referent. Put the claim before detailed evidence, use verbs instead of abstract noun phrases, and end a sentence on the new fact the reader should remember.
|
||||
|
||||
Do not write like a paper, specification, PR description, release note, test log, or compliance report. Build and KVM evidence belongs in compilation and execution, where it should support a claim instead of becoming the article's main plot.
|
||||
|
||||
## Keep the source readable
|
||||
@@ -39,7 +43,7 @@ Keep local infrastructure private. Do not name workspace paths, shared lab repos
|
||||
|
||||
Describe what the implementation actually provides. A bounded lab command is a bounded lab command. Do not inflate it into a daemon, controller, production scheduler, security product, or operational platform.
|
||||
|
||||
State requirements, one meaningful failure path, cleanup behavior, and limitations. Say each important boundary once, at the point where the reader needs it. Move low-level kernel provenance into a compact requirements or reproducibility note.
|
||||
State requirements and explain cleanup through the normal lifecycle. Collect failure conditions, limitations, and safety boundaries into one compact paragraph of at most two sentences near the end. Move low-level kernel provenance into a compact requirements or reproducibility note.
|
||||
|
||||
## Final reader check
|
||||
|
||||
|
||||
@@ -29,6 +29,29 @@ Use it as a reader-focused editing guide, not as a reason to add review rounds.
|
||||
- Do not let provenance become the plot. Kernel commits, guest versions, CI details, and test matrices belong in a compact reproducibility note unless the lesson is specifically about them.
|
||||
- Match the scenario to the tool. A small fixture, lab command, or feature demonstration can be valuable without being described as a production service.
|
||||
|
||||
## Positive and concrete sentences
|
||||
|
||||
- Use a positive statement of behavior or scope. Write “The loader observes one child that it creates” instead of “The loader does not monitor every exec on the system.” Write “The example implements one aggregate FIFO” instead of opening with the scheduler policies it lacks.
|
||||
- Rewrite `not`, `do not`, `does not`, `cannot`, `will not`, `不要`, `不能`, `不会`, `并非` and `别` whenever an accurate positive form exists. Remove double negatives and paragraphs built from consecutive negative sentences.
|
||||
- Keep the supported scope exact while using positive wording. “The example focuses on one child” describes the implemented behavior without implying that system-wide monitoring already exists.
|
||||
- Collect failure conditions, unsupported behavior, limitations, and safety boundaries near the end in one paragraph of at most two sentences. The main narrative should stay with the working path.
|
||||
- Start important sentences with a concrete actor such as the hook, BPF program, map, callback, loader, fixture, kernel, or command. Keep that subject close to its verb and prefer active voice when ownership or sequencing matters.
|
||||
- Connect three or more short declarative sentences through cause, contrast, or sequence. A pair of short sentences can create emphasis, while a longer note-like run should become a causal paragraph.
|
||||
- Give vague referents a name. Replace an unclear `this`, `it`, `they`, `这`, `它` or `这种方式` with the component or mechanism it denotes.
|
||||
- Put the claim or practical meaning before a block of numbers, counters, or output. The reader should know what the evidence demonstrates before reading the evidence.
|
||||
- Prefer direct verbs over nominalizations and filler. Use “the callback reads,” “the loader attaches,” and “the test verifies” instead of “performs a read,” “conducts attachment,” or “provides verification.”
|
||||
- Place known context near the sentence opening and the new result near the end. This topic-to-stress order helps adjacent sentences form one path instead of a fact catalog.
|
||||
|
||||
Treat this wording as a negative example:
|
||||
|
||||
> 这个例子故意只做聚合 FIFO,没有 class、公平调度、ECN、burst 控制。用它做实验可以,但别往物理网卡上挂,也别当生产调度器。
|
||||
|
||||
The paragraph defines the example through missing features and repeated warnings, so the useful mechanism disappears behind negation. Rewrite it around the implemented path and a concrete learning setting:
|
||||
|
||||
> 这个例子用一条聚合 FIFO 展示 skb 所有权、发送时序和 qdisc 清理,适合在 veth、TAP 或 IFB 这类受控接口上观察完整流程,更完整的调度器可以在此基础上加入 class、公平调度、ECN 和 burst 控制。
|
||||
|
||||
Apply the same repair in English. Replace a paragraph built from “no classes,” “not production,” and “do not attach” with the mechanism the reader can run, the controlled setting that fits it, and the natural extensions that follow.
|
||||
|
||||
## Paragraph and sentence checks
|
||||
|
||||
- English paragraphs usually work best at 40–90 words. Inspect every paragraph above 110 words. Three consecutive paragraphs above 90 words are **Must fix**.
|
||||
@@ -37,6 +60,7 @@ Use it as a reader-focused editing guide, not as a reason to add review rounds.
|
||||
- Keep a sentence's subject near its verb. Split long modifiers, dangling introductions, and sentences that make the reader hold several clauses before reaching the action.
|
||||
- Avoid weak openings such as “It is,” “There is,” and “This is” when a concrete subject is available.
|
||||
- Do not stack three or more short note-like sentences. Connect cause, mechanism, and consequence.
|
||||
- Avoid a pair of neighboring negative sentences when positive wording can carry the same facts. Reserve the compact final boundary paragraph for the remaining limits.
|
||||
- Cut filler such as “in order to,” “utilize,” “it is important to note that,” “due to the fact that,” “in terms of,” and “with respect to.” Prefer direct verbs.
|
||||
- Do not use spaced English em dashes (` — `) or Chinese em dashes (`——`) in prose.
|
||||
- Do not join independent clauses with semicolons. Use two sentences or a conjunction.
|
||||
|
||||
@@ -13,7 +13,7 @@ Invoke `$bpf-tutorial-writing-style` before writing or reviewing README prose.
|
||||
|
||||
Use the exact model ID `claude-opus-4-5-20251101` through Claude Code. Never use `opus`, `latest`, a default model, a fallback model, or another provider for tutorial prose. If this exact model is unavailable, stop and report the block instead of substituting another writer.
|
||||
|
||||
Use exactly one non-interactive Claude invocation for one lesson. Require Opus to edit the existing README files in place, one paragraph at a time and in document order. It must not generate a replacement article and overwrite the file as a whole. It must preserve the existing code-block positions while revising the prose around each block, first completing natural Chinese and then matching English from the same facts.
|
||||
Use exactly one non-interactive Claude invocation for one lesson. Require Opus to edit the existing README files in place, one specific sentence or paragraph at a time and in document order. Each Edit operation must have a narrow target. It must not generate a replacement article and overwrite the file as a whole. It must preserve the existing code-block positions while revising the prose around each block, first completing natural Chinese and then matching English from the same facts.
|
||||
|
||||
The initial prompt must contain the complete task, source-fidelity rules, style rules, and final audit checklist. Opus must not ask Codex or the user a question, pause for confirmation, return a partial progress report, or stop after one language or one section. It may return only after both README files have been rewritten from beginning to end and it has run its own baseline comparison and formatting checks. Do not split the main rewrite into planned paragraph batches, switch models, or let Codex fill in prose afterward.
|
||||
|
||||
@@ -62,7 +62,7 @@ Include the complete core source exactly as implemented, then walk through the i
|
||||
|
||||
Follow the selected precedent's component rhythm. Introduce one component, present its complete source inline, and explain its important logic before moving to the next component. Do not hide source in `<details>` or collect every file into one uninterrupted source dump. The source must remain searchable, copyable, and byte-exact.
|
||||
|
||||
Explain advanced eBPF behavior, not ordinary C syntax. Keep build, run, expected output, requirements, cleanup, limitations, summary, and primary references. State once what the evidence proves and once where the example stops.
|
||||
Explain advanced eBPF behavior, not ordinary C syntax. Keep build, run, expected output, requirements, summary, and primary references. Explain cleanup as part of the normal mechanism instead of turning it into a warning section. Compress failure conditions, limitations, and safety boundaries into one short paragraph of at most two sentences near the end.
|
||||
|
||||
Use canonical GitHub absolute URLs for every Markdown link, including links to the current lesson's source, `Makefile`, and tests. Never publish a `./` or `../` target or a link to another host. If no stable GitHub URL exists, omit the link. This repository rule overrides link examples in older lessons and the advanced guideline's website call to action.
|
||||
|
||||
@@ -88,13 +88,13 @@ Read both files from top to bottom as an intermediate eBPF developer. Fix the te
|
||||
|
||||
- the opening reads like an abstract, specification, PR description, or test report;
|
||||
- a large code wall arrives before the reader has a useful mental model;
|
||||
- setup, conflicts, signals, KVM provenance, or limitations repeat;
|
||||
- setup, conflicts, signals, KVM provenance, or limitations interrupt the main mechanism;
|
||||
- a section catalogs facts without explaining cause and effect;
|
||||
- the scenario promises a tool more capable than the implementation;
|
||||
- Chinese follows English word order or switches languages unnecessarily;
|
||||
- the reader reaches the end remembering only a feature name or validation transcript.
|
||||
|
||||
For a rewrite, compare the finished pair with the entry version once. Confirm that code, commands, captured output, versions, requirements, failure behavior, cleanup, limitations, and primary references did not disappear or change. Every removed passage should be repetition, stale framing, or material that moved to a better place. Word counts, heading counts, and repeated-term counts can expose bloat, but they are diagnostics rather than targets.
|
||||
For a rewrite, compare the finished pair with the entry version once. Confirm that code, commands, captured output, versions, requirements, cleanup, the compact final boundary, and primary references remain accurate. Failure and limitation details may be condensed into the required two-sentence ending instead of surviving as a catalog. Every other removed passage should be repetition, stale framing, or material that moved to a better place. Word counts, heading counts, and repeated-term counts can expose bloat, but they are diagnostics rather than targets.
|
||||
|
||||
This is the normal review gate. Keep the pinned Opus session as the only prose editor. Codex reports concrete defects and reruns deterministic checks; Opus revises the affected paragraphs. The exact model identity is required by the workflow, but it is not evidence of quality. Only the finished artifact and passing checks are evidence.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user