diff --git a/.gitignore b/.gitignore index 0dd8bdaa7..02e110550 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,13 @@ __pycache__/ /.pnpm-store/ deployments/archie/.build/ .codebase-memory/ + +# Vale synced packages, dictionaries, and grammars (recreated by `vale sync`). +# Local house rules (.vale/styles/Archie/) and vocabulary stay tracked. +/.vale/styles/* +!/.vale/styles/Archie/ +!/.vale/styles/config/ +/.vale/styles/config/* +!/.vale/styles/config/vocabularies/ +/.vale/styles/config/vocabularies/* +!/.vale/styles/config/vocabularies/Archie/ diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 000000000..5900538a0 --- /dev/null +++ b/.vale.ini @@ -0,0 +1,86 @@ +StylesPath = .vale/styles +MinAlertLevel = warning +Vocab = Archie + +# Run `vale sync` to install external packages and the Go comment grammar. +Packages = Google, Microsoft, Voices, TechTerms, Comments, Prompts +Grammars = go + +[formats] +tmpl = md + +[*.{md,tmpl}] +# Ignore Go/workflow template expressions such as {{ steps.plan.summary }}. +TokenIgnores = (\{\{[^}]*\}\}) + +BasedOnStyles = Vale, Voices, Direct, Google, Archie + +# Australian English and Archie's technical prose conventions: +Google.Spelling = NO +Google.Quotes = NO +Google.DateFormat = NO +Google.OxfordComma = NO +Google.EmDash = NO +Google.Contractions = NO +Google.Parens = NO +Google.Semicolons = NO +Google.Colons = NO +Google.Units = NO +Google.Acronyms = NO +Google.WordList = NO +Google.WordListCase = NO + +# Keep style nudges advisory (visible with --minAlertLevel=suggestion). +Google.Headings = suggestion +Google.Latin = suggestion +Google.Exclamation = warning +Google.FirstPerson = suggestion +Google.We = suggestion +Google.Will = suggestion + +# Selective Microsoft rules (UI verbs, inclusive terminology, hyphens) without +# pulling in Microsoft-specific product jargon (e.g. agent -> personal digital assistant). +Microsoft.UIVerbs = warning +Microsoft.BiasFree = warning +Microsoft.Auto = warning +Microsoft.Suspended = warning +Microsoft.Accessibility = suggestion +Microsoft.Uppercase = suggestion + +# "Term: explanation" is idiomatic throughout Archie's docs and comments. +Voices.ColonReveal = NO + +# Replaced by Archie.Readability and Archie.SentenceLength, calibrated for technical docs. +Direct.Ease = NO +Direct.Length = NO +Direct.Hedging = warning +Direct.Preamble = warning + +# Agent instruction and skill files get additional prompt-quality checks. +[{AGENTS,CLAUDE,SKILL}.md] +BasedOnStyles = Vale, Voices, Direct, Google, Archie, Prompts + +# Model prompts are plain text (no Markdown bold) and reference tool names inline. +[internal/prompts/*.{md,tmpl}] +Vale.Spelling = suggestion +Archie.UILabelFormat = NO + +# Go source comments: doc conventions, spelling, clarity, and no migration narration. +[*.go] +BasedOnStyles = Vale, Voices, Comments, GoDoc, Archie + +# Go comments often mention camelCase/snake_case identifiers without backticks, +# so keep spelling advisory here. +Vale.Spelling = suggestion + +# Upstream GoDoc.Sentence regex backtracks heavily on long comment blocks. +GoDoc.Sentence = NO +Voices.ColonReveal = NO +Archie.Readability = NO +Archie.SentenceLength = NO +Archie.UIElementType = NO +Archie.UILabelFormat = NO + +# Never lint generated Go files (protobuf, sqlc). +[*.{pb,sql}.go] +BasedOnStyles = diff --git a/.vale/styles/Archie/AustralianEnglish.yml b/.vale/styles/Archie/AustralianEnglish.yml new file mode 100644 index 000000000..ba789e777 --- /dev/null +++ b/.vale/styles/Archie/AustralianEnglish.yml @@ -0,0 +1,154 @@ +# Enforce Australian English spelling in prose. +# Intentionally omits computing standards that use US forms in Australia +# (program, disk, artifact) and verb/noun pairs (licence/license, practise/practice). +extends: substitution +message: "Use Australian English '%s' instead of '%s'." +level: warning +ignorecase: true +action: + name: replace +# Exact-case exceptions for HTTP headers and Go method names. +exceptions: + - Authorize + - Authorization +swap: + analyze: analyse + analyzed: analysed + analyzes: analyses + analyzing: analysing + authorization: authorisation + authorizations: authorisations + authorize: authorise + authorized: authorised + authorizes: authorises + authorizing: authorising + behavior: behaviour + behavioral: behavioural + behaviors: behaviours + canceled: cancelled + canceling: cancelling + canonicalize: canonicalise + canonicalized: canonicalised + canonicalizes: canonicalises + canonicalizing: canonicalising + catalog: catalogue + cataloged: catalogued + cataloging: cataloguing + catalogs: catalogues + categorization: categorisation + categorize: categorise + categorized: categorised + categorizes: categorises + categorizing: categorising + center: centre + centered: centred + centering: centring + centers: centres + color: colour + colored: coloured + coloring: colouring + colors: colours + customization: customisation + customize: customise + customized: customised + customizes: customises + customizing: customising + favor: favour + favored: favoured + favoring: favouring + favorite: favourite + favorites: favourites + favors: favours + finalize: finalise + finalized: finalised + finalizes: finalises + finalizing: finalising + fulfill: fulfil + fulfillment: fulfilment + fulfills: fulfils + initialization: initialisation + initialize: initialise + initialized: initialised + initializes: initialises + initializing: initialising + judgment: judgement + judgments: judgements + labeled: labelled + labeling: labelling + maximize: maximise + maximized: maximised + maximizes: maximises + maximizing: maximising + minimize: minimise + minimized: minimised + minimizes: minimises + minimizing: minimising + modeled: modelled + modeling: modelling + normalization: normalisation + normalize: normalise + normalized: normalised + normalizes: normalises + normalizing: normalising + optimization: optimisation + optimizations: optimisations + optimize: optimise + optimized: optimised + optimizes: optimises + optimizing: optimising + organization: organisation + organizational: organisational + organizations: organisations + organize: organise + organized: organised + organizes: organises + organizing: organising + parameterize: parameterise + parameterized: parameterised + parameterizes: parameterises + parameterizing: parameterising + prioritize: prioritise + prioritized: prioritised + prioritizes: prioritises + prioritizing: prioritising + recognize: recognise + recognized: recognised + recognizes: recognises + recognizing: recognising + sanitization: sanitisation + sanitize: sanitise + sanitized: sanitised + sanitizes: sanitises + sanitizing: sanitising + serialization: serialisation + serialize: serialise + serialized: serialised + serializes: serialises + serializing: serialising + stabilize: stabilise + stabilized: stabilised + stabilizes: stabilises + stabilizing: stabilising + summarize: summarise + summarized: summarised + summarizes: summarises + summarizing: summarising + synchronization: synchronisation + synchronize: synchronise + synchronized: synchronised + synchronizes: synchronises + synchronizing: synchronising + unauthorized: unauthorised + +tests: + - name: flags US spelling + input: | + The organization enforces authorization behavior. + want: | + 1:5:Archie.AustralianEnglish:Use Australian English 'organisation' instead of 'organization'. + 1:27:Archie.AustralianEnglish:Use Australian English 'authorisation' instead of 'authorization'. + 1:41:Archie.AustralianEnglish:Use Australian English 'behaviour' instead of 'behavior'. + - name: accepts Australian spelling and inline code + input: | + The organisation enforces authorisation behaviour via `behavior_flag`. + want: "" diff --git a/.vale/styles/Archie/NoMigrationNarration.yml b/.vale/styles/Archie/NoMigrationNarration.yml new file mode 100644 index 000000000..14d3ffc8d --- /dev/null +++ b/.vale/styles/Archie/NoMigrationNarration.yml @@ -0,0 +1,29 @@ +# AGENTS.md: "Comments explain why, not what the code already says. +# No migration history, phase names or issue narration in code." +extends: existence +message: "Avoid migration or plan narration ('%s') in code comments. Explain what the code does or why." +level: warning +scope: comment.go +ignorecase: true +nonword: true +tokens: + - '\b(?:phase|wave|slice|sprint)\s+\d+\b' + - '\bepic\s+#\d+\b' + - '\b(?:formerly|previously)\s+(?:called|named|known as)\b' + - '\b(?:migrated|moved|extracted|ported)\s+from\b' + +tests: + - name: flags migration narration in Go comments + format: go + input: | + // Phase 2 moved from internal/legacy. + package demo + want: | + 1:4:Archie.NoMigrationNarration:Avoid migration or plan narration ('Phase 2') in code comments. Explain what the code does or why. + 1:12:Archie.NoMigrationNarration:Avoid migration or plan narration ('moved from') in code comments. Explain what the code does or why. + - name: allows normal rationale comments + format: go + input: | + // Verify the HMAC before parsing so malformed payloads cannot trigger work. + package demo + want: "" diff --git a/.vale/styles/Archie/Readability.yml b/.vale/styles/Archie/Readability.yml new file mode 100644 index 000000000..d76194b5f --- /dev/null +++ b/.vale/styles/Archie/Readability.yml @@ -0,0 +1,21 @@ +# Calibrated for developer documentation: crisp technical docs with domain +# terminology typically score 8-11 on Flesch-Kincaid; higher scores usually +# signal dense paragraphs that benefit from simpler structure. +extends: metric +message: "Try to keep the Flesch-Kincaid grade level (%s) at or below 11." +link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests +level: warning +formula: | + (0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59 +condition: "> 11" + +tests: + - name: flags dense technical prose + input: | + Notwithstanding architectural encapsulation prerequisites, interdepartmental orchestration mechanisms necessitate comprehensive deterministic authentication verification across heterogeneous distributed administrative infrastructures. + want: | + 1:1:Archie.Readability:Try to keep the Flesch-Kincaid grade level (42.40) at or below 11. + - name: accepts clear technical prose + input: | + A source receives events and checks their HMAC signature. A mapping extracts named fields from the payload. A binding selects the workflow to run. + want: "" diff --git a/.vale/styles/Archie/SentenceLength.yml b/.vale/styles/Archie/SentenceLength.yml new file mode 100644 index 000000000..69709ba4a --- /dev/null +++ b/.vale/styles/Archie/SentenceLength.yml @@ -0,0 +1,17 @@ +# Flag overly long sentences in documentation. Set to 35 words so precise +# technical constraints fit comfortably while runaway sentences are caught. +extends: Std.Readability.SentenceLength +message: "This sentence has %d words. Consider splitting it for readability." +level: warning +max: 35 + +tests: + - name: flags long sentence + input: | + When the daemon starts a new workflow run for an incoming event that matched a signed binding, it loads the published workflow definition from storage, allocates an isolated container workspace, prepares task-scoped credentials, and dispatches the first step immediately without waiting. + want: | + 1:1:Archie.SentenceLength:This sentence has 42 words. Consider splitting it for readability. + - name: accepts concise technical sentences + input: | + The daemon loads the published workflow definition and allocates an isolated container workspace. It prepares task-scoped credentials before dispatching the first step. + want: "" diff --git a/.vale/styles/Archie/UIElementType.yml b/.vale/styles/Archie/UIElementType.yml new file mode 100644 index 000000000..8425ddd77 --- /dev/null +++ b/.vale/styles/Archie/UIElementType.yml @@ -0,0 +1,22 @@ +# Microsoft Writing Style Guide: "Don't include the type of UI element, such as +# button or checkbox, unless including it adds needed clarity." +extends: existence +message: "Omit the UI element type after a bold label ('%s') unless it adds clarity." +link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui +level: warning +scope: raw +nonword: true +tokens: + - '\*\*[^*\n]{1,40}\*\*\s+(?:button|checkbox|check box|dropdown|drop-down|field|icon|link|menu|option|switch|tab|toggle)\b' + +tests: + - name: flags bold label followed by UI element type + input: | + Select the **Save** button and leave the **Shared secret** field blank. + want: | + 1:12:Archie.UIElementType:Omit the UI element type after a bold label ('**Save** button') unless it adds clarity. + 1:42:Archie.UIElementType:Omit the UI element type after a bold label ('**Shared secret** field') unless it adds clarity. + - name: allows bold UI label without element type + input: | + Select **Save** and leave **Shared secret** blank. + want: "" diff --git a/.vale/styles/Archie/UIInteractions.yml b/.vale/styles/Archie/UIInteractions.yml new file mode 100644 index 000000000..0b8152532 --- /dev/null +++ b/.vale/styles/Archie/UIInteractions.yml @@ -0,0 +1,46 @@ +# Input-neutral UI interaction verbs complementing Microsoft.UIVerbs. +# Based on Microsoft Writing Style Guide: Describing interactions with UI. +extends: substitution +message: "Use the input-neutral UI verb '%s' instead of '%s'." +link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui +level: warning +ignorecase: true +action: + name: replace +swap: + deselect: clear + deselected: cleared + deselecting: clearing + deselects: clears + drag and drop: drag + drag-and-drop: drag + key in: enter + keyed in: entered + keying in: entering + mouse over: hover over + moused over: hovered over + mousing over: hovering over + navigate to: go to + navigated to: went to + navigating to: going to + press and hold: select and hold + tap and hold: select and hold + tap on: select + tapped on: selected + tapping on: selecting + uncheck: clear + unchecking: clearing + unchecks: clears + +tests: + - name: flags input-specific UI verbs + input: | + Navigate to Settings, uncheck Auto-save, and mouse over the badge. + want: | + 1:1:Archie.UIInteractions:Use the input-neutral UI verb 'go to' instead of 'Navigate to'. + 1:23:Archie.UIInteractions:Use the input-neutral UI verb 'clear' instead of 'uncheck'. + 1:46:Archie.UIInteractions:Use the input-neutral UI verb 'hover over' instead of 'mouse over'. + - name: accepts input-neutral UI verbs + input: | + Go to Settings, clear Auto-save, and hover over the badge. + want: "" diff --git a/.vale/styles/Archie/UILabelFormat.yml b/.vale/styles/Archie/UILabelFormat.yml new file mode 100644 index 000000000..95252377b --- /dev/null +++ b/.vale/styles/Archie/UILabelFormat.yml @@ -0,0 +1,26 @@ +# Microsoft Writing Style Guide: +# - Use bold formatting for UI element names, not quotation marks. +# - Omit trailing colons or ellipses from UI labels in instructions. +extends: existence +message: "Format UI labels in bold without quotes or trailing punctuation ('%s')." +link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui +level: warning +scope: raw +ignorecase: true +nonword: true +tokens: + - '\b(?:select|choose|open|clear|go to|hover over)\s+"[^"\n]{1,40}"' + - '\b(?:select|choose|open|clear|go to|hover over)\s+\*\*[^*\n]{1,40}(?::|\.{3}|…)\*\*' + +tests: + - name: flags quoted UI labels and trailing punctuation + input: | + Select "Save" or choose **Export...** and open **Settings:**. + want: | + 1:1:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('Select "Save"'). + 1:18:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('choose **Export...**'). + 1:43:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('open **Settings:**'). + - name: accepts clean bold UI labels + input: | + Select **Save**, choose **Export**, and open **Settings**. + want: "" diff --git a/.vale/styles/Archie/Wordiness.yml b/.vale/styles/Archie/Wordiness.yml new file mode 100644 index 000000000..b35b33918 --- /dev/null +++ b/.vale/styles/Archie/Wordiness.yml @@ -0,0 +1,44 @@ +# Prefer concise wording over wordy phrases. +extends: substitution +message: "Use '%s' instead of '%s'." +level: warning +ignorecase: true +action: + name: replace +swap: + a large number of: many + a majority of: most + a sufficient number of: enough + as a means of: to + at this point in time: now + due to the fact that: because + for the purpose of: to + has the capability to: can + in close proximity to: near + in excess of: more than + in spite of the fact that: although + in the event that: if + in the near future: soon + make use of: use + on a daily basis: daily + on a monthly basis: monthly + on a weekly basis: weekly + prior to: before + subsequent to: after + take advantage of: use + until such time as: until + whether or not: whether + with regard to: about + with respect to: about + +tests: + - name: flags wordy phrases + input: | + Check the signature prior to parsing due to the fact that payloads are untrusted. + want: | + 1:21:Archie.Wordiness:Use 'before' instead of 'prior to'. + 1:38:Archie.Wordiness:Use 'because' instead of 'due to the fact that'. + - name: accepts concise wording + input: | + Check the signature before parsing because payloads are untrusted. + want: "" diff --git a/.vale/styles/config/vocabularies/Archie/accept.txt b/.vale/styles/config/vocabularies/Archie/accept.txt new file mode 100644 index 000000000..3b98b1dfb --- /dev/null +++ b/.vale/styles/config/vocabularies/Archie/accept.txt @@ -0,0 +1,30 @@ +# Case-insensitive common terms (matched in any capitalisation) +(?i)approvers? +(?i)archipelago +(?i)canonicalis(?:e[ds]?|ing) +(?i)carina +(?i)confirmers? +(?i)fulfilment +(?i)passkeys? +(?i)reapprovals? +(?i)redemptions? +(?i)retags? +(?i)undispatched +(?i)unpushed +(?i)worktrees? + +# Proper nouns, tools, and exact-case technical terms +archied +Catlow +depguard +gosec +govulncheck +hclog +Huma +Miessler +Pdeathsig +prbench +Reka +releaseupdate +secretengine +sqlc