CAT-K5: a section is a part with a plain title, never a file; a reference has one form
A new rule, section-form (31 now), refuses from the day the records move a section whose title is a file name, a number prefix, a slash or over 200 bytes, a title twice in a record, and a text that holds a local path, a file and line, or a link to a file. Only a section that is new or changed is judged, so a record imported with file-named sections keeps them until its form-only version; write refuses at once. Issue 1966. Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -2,7 +2,7 @@ package main
|
||||
|
||||
// The rules a record is held to (novox/hq ADR 0290 rule 4, to-be 55 §4 and §5).
|
||||
//
|
||||
// **30 rules judge one record or its prose**, and `propose` refuses a record that breaks any of them, naming every
|
||||
// **31 rules judge one record or its prose**, and `propose` refuses a record that breaks any of them, naming every
|
||||
// one it breaks at once. They are hq's checks (00-META/checks/records.py, cycle.py, index.py, words.py) as they
|
||||
// judge one record, moved to the write: 25 on its structure, 4 on its prose; and the brief a record that needs
|
||||
// the operator is asked with (novox/hq issue 639). Each has an id, said in the refusal,
|
||||
@@ -28,7 +28,7 @@ type Rule struct {
|
||||
From string
|
||||
}
|
||||
|
||||
// PerRecordRules are the 30, in the order they are judged.
|
||||
// PerRecordRules are the 31, in the order they are judged.
|
||||
var PerRecordRules = []Rule{
|
||||
{"kind", "a record is a decision or a research effort", "cycle.py"},
|
||||
{"reserved", "its number was reserved for its kind and holds no other record", "cycle.py (duplicate numbers)"},
|
||||
@@ -60,6 +60,7 @@ var PerRecordRules = []Rule{
|
||||
{"deferral", "a paragraph that puts work off names the issue that tracks it", "cycle.py deferrals"},
|
||||
{"insight-form", "a progressive insight its text mentions is in the dated, marked form", "records.py insights"},
|
||||
{"brief", "a record that needs the operator carries a brief its ask reads at a glance: a headline, a summary, at most three points, each fit for the phone", "novox/hq issue 639"},
|
||||
{"section-form", "a section is a part with a plain title, once in the record, and its text holds no local path, no file and line, and no link to a file", "to-be 55 §2.2"},
|
||||
}
|
||||
|
||||
// Refusal is one rule a record breaks, and how.
|
||||
@@ -120,7 +121,7 @@ func allText(r *Record) string {
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// JudgeRecord holds a proposed record to the 30 rules. held is the entry its number holds (a reservation, the
|
||||
// JudgeRecord holds a proposed record to the 31 rules. held is the entry its number holds (a reservation, the
|
||||
// proposal being revised, or the accepted record an insight corrects); lookup reads every other record.
|
||||
func JudgeRecord(r *Record, held *Entry, lookup Lookup, ref *Reference) []Refusal {
|
||||
return JudgeRecordOn(r, held, lookup, ref, r.Date)
|
||||
@@ -320,6 +321,19 @@ func JudgeRecordOn(r *Record, held *Entry, lookup Lookup, ref *Reference, day st
|
||||
}
|
||||
}
|
||||
}
|
||||
seen := map[string]bool{}
|
||||
for _, s := range r.Sections {
|
||||
if seen[s.Name] {
|
||||
refuse("section-form", "the section %q is in the record twice: a title is once in its record", s.Name)
|
||||
}
|
||||
seen[s.Name] = true
|
||||
if unchangedSection(held, s) {
|
||||
continue
|
||||
}
|
||||
for _, p := range sectionFormProblems(s.Name, s.Text) {
|
||||
refuse("section-form", "%s", p)
|
||||
}
|
||||
}
|
||||
text := allText(r)
|
||||
if words := ref.RetiredIn(text); len(words) > 0 {
|
||||
refuse("retired-word", "it uses %s, retired by the glossary", quoteAll(unique(words)))
|
||||
@@ -616,6 +630,9 @@ var RuleFrom = map[string]string{
|
||||
"checked": "2026-10-11",
|
||||
"live-citation": "2026-10-11",
|
||||
"brief": "2026-10-13",
|
||||
// A section is a part with a title, never a file (to-be 55 §2.2): the day the records move to the ledger. A record
|
||||
// imported with file-named sections keeps them until its form-only version, so a section left alone is not judged.
|
||||
"section-form": "2026-11-04",
|
||||
}
|
||||
|
||||
// DecisionFrom overrides RuleFrom for a decision record: hq's words check never read 02-DECISIONS ("a decision
|
||||
|
||||
Reference in New Issue
Block a user