Skip to content

Commit ac44b6b

Browse files
committed
chore: add remark markdown linting and fix docs
Why: Keep markdown style consistent and catch issues automatically. What: - Add remark tooling, ignore build dirs, and reformat docs to match rules.
1 parent 34aa979 commit ac44b6b

10 files changed

Lines changed: 16981 additions & 13909 deletions

File tree

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
---
1+
***
2+
23
name: Feature request
34
about: Suggest an idea for this project
45
title: ''
56
labels: ''
67
assignees: ''
78

8-
---
9+
***
910

1011
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
A clear and concise description of what the problem is. Ex. I'm always frustrated when \[...]
1213

1314
**Describe the solution you'd like**
1415
A clear and concise description of what you want to happen.

.remarkignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
dist/
3+
temp/
4+
coverage/
5+
tests/

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# v0.1.0-alpha.1 / 2025-11-15
2-
- Initial release.
2+
3+
* Initial release.

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ the community.
116116

117117
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118118
version 2.0, available at
119-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119+
https://www.contributor-covenant.org/version/2/0/code\_of\_conduct.html.
120120

121121
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122122
enforcement ladder](https://github.com/mozilla/diversity).

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ improving documentation, or just giving feedback, it’s all welcome.
55

66
## How to Contribute
77

8-
- Open an [issue](https://github.com/GWALN/cli/issues) and describe what’s going on.
8+
* Open an [issue](https://github.com/GWALN/cli/issues) and describe what’s going on.
99

10-
- Fork the repo -> create a new branch -> commit changes -> open a PR.
10+
* Fork the repo -> create a new branch -> commit changes -> open a PR.
1111
Keep commits focused and descriptive.
1212

13-
- Typos, clarity, formatting, everything counts. You can edit directly and open a PR.
13+
* Typos, clarity, formatting, everything counts. You can edit directly and open a PR.
1414

15-
- Before submitting a PR, run local tests and verify expected CLI behavior with the mock API.
15+
* Before submitting a PR, run local tests and verify expected CLI behavior with the mock API.
1616

1717
## Resources
1818

19-
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
20-
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
21-
- [GitHub Help](https://help.github.com)
19+
* [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
20+
* [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
21+
* [GitHub Help](https://help.github.com)
2222

2323
## License
2424

README.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
![Image](https://github.com/user-attachments/assets/3152cf8b-b683-4acf-ab9d-e3bfd5dc0390)
22

3-
> [!NOTE]
3+
> \[!NOTE]\
44
> Originally built for the **DKGcon2025 Hackathon** powered by OriginTrail.
55
6-
## GWALN CLI
6+
## GWALN
77

88
This tool helps you compare Grokipedia and Wikipedia topics. It parses
99
structured snapshots, computes discrepancies, and drafts Community Notes
@@ -36,15 +36,15 @@ whether to publish.
3636

3737
Before using this tool, you should be familiar with:
3838

39-
- Basic command-line usage and Node.js tooling.
40-
- OriginTrail concepts, including DKG nodes and Knowledge Assets.
39+
* Basic command-line usage and Node.js tooling.
40+
* OriginTrail concepts, including DKG nodes and Knowledge Assets.
4141

4242
You should have:
4343

44-
- Node.js 18 or later on macOS, Linux, or Windows.
45-
- Network access to a DKG edge node and sufficient blockchain funds if
44+
* Node.js 18 or later on macOS, Linux, or Windows.
45+
* Network access to a DKG edge node and sufficient blockchain funds if
4646
you plan to publish.
47-
- Optional: a Google Gemini API key if you use automated bias
47+
* Optional: a Google Gemini API key if you use automated bias
4848
verification.
4949

5050
## How to use GWALN CLI
@@ -74,6 +74,7 @@ You should have:
7474
### Fetch topic snapshots
7575

7676
1. Select a topic ID from `topics.json` (for example, `moon`).
77+
7778
2. Download raw Wikipedia data:
7879

7980
```bash
@@ -125,6 +126,7 @@ You should have:
125126
```
126127

127128
2. Inspect the output in `notes/moon.json` and `notes/index.json`.
129+
128130
3. Publish to OriginTrail (ensure your config has live signing keys):
129131

130132
```bash
@@ -171,11 +173,11 @@ logic.
171173

172174
Each MCP tool mirrors the CLI flags:
173175

174-
- `fetch`: `{ source?, topicId? }`
175-
- `analyze`: `{ topicId?, force?, biasVerifier?, geminiKey?, geminiModel?, geminiSummary?, verifyCitations? }`
176-
- `notes`: discriminated union for `build`, `publish`, or `status`
177-
- `publish`: `{ filePath? , payload?, privacy?, endpoint?, environment?, ... }`
178-
- `show`: `{ topicId, renderHtml? }`
176+
* `fetch`: `{ source?, topicId? }`
177+
* `analyze`: `{ topicId?, force?, biasVerifier?, geminiKey?, geminiModel?, geminiSummary?, verifyCitations? }`
178+
* `notes`: discriminated union for `build`, `publish`, or `status`
179+
* `publish`: `{ filePath? , payload?, privacy?, endpoint?, environment?, ... }`
180+
* `show`: `{ topicId, renderHtml? }`
179181

180182
Because the MCP server calls the same workflow modules as the CLI,
181183
cached files, Gemini credentials, and `.gwalnrc.json` are honored
@@ -214,15 +216,17 @@ This retrieves the assertion and optional metadata, displays them in the termina
214216
## Troubleshooting
215217

216218
`Analysis not found for topic`
217-
- Run both `gwaln fetch wiki --topic <id>` and `gwaln fetch grok --topic <id>` before analyzing.
219+
220+
* Run both `gwaln fetch wiki --topic <id>` and `gwaln fetch grok --topic <id>` before analyzing.
218221

219222
`DKG publish failed: UNAUTHORIZED`
220-
- Ensure `.gwalnrc.json` contains valid `dkgPrivateKey`, `dkgPublicKey`, and endpoint values; confirm the key has sufficient balance on the target chain.
223+
224+
* Ensure `.gwalnrc.json` contains valid `dkgPrivateKey`, `dkgPublicKey`, and endpoint values; confirm the key has sufficient balance on the target chain.
221225

222226
## How to get help and report issues
223227

224-
- Report issues at the GitHub issue tracker for this repository.
225-
- Ask questions by opening a discussion or contacting the maintainers on
228+
* Report issues at the GitHub issue tracker for this repository.
229+
* Ask questions by opening a discussion or contacting the maintainers on
226230
the project chat. You can expect a response within one week.
227231

228232
## Developer documentation
@@ -237,27 +241,27 @@ handled by a custom module that converts Wikipedia wikitext and
237241
Grokipedia HTML into identical structured JSON (lead/sections, sentences,
238242
claims, citations, media attachments). The analyzer stage:
239243

240-
- normalizes sentences into token sets and compares them to detect
244+
* normalizes sentences into token sets and compares them to detect
241245
missing or extra context
242-
- aligns sections and claims using cosine similarity from the
246+
* aligns sections and claims using cosine similarity from the
243247
`string-similarity` library
244-
- computes numeric discrepancies via relative-difference heuristics and
248+
* computes numeric discrepancies via relative-difference heuristics and
245249
entity discrepancies via set symmetric differences
246-
- flags bias/hallucination cues through lexicon scans plus
250+
* flags bias/hallucination cues through lexicon scans plus
247251
subjectivity/polarity scoring
248252

249253
Optional verification hooks call the Gemini API for bias confirmation and
250254
run citation checks against Grokipedia references.
251255

252256
### Code structure
253257

254-
- `src/commands/`: CLI entry points (`init`, `fetch`, `analyse`, `show`,
258+
* `src/commands/`: CLI entry points (`init`, `fetch`, `analyse`, `show`,
255259
`notes`, `topics`, `publish`, `query`).
256-
- `src/lib/`: reusable modules including the parser, analyzer,
260+
* `src/lib/`: reusable modules including the parser, analyzer,
257261
discrepancies, bias metrics, and DKG helpers.
258-
- `data/`: cached structured snapshots per topic.
259-
- `analysis/`: analyzer outputs (JSON + HTML report).
260-
- `notes/`: JSON-LD Community Notes and index metadata.
262+
* `data/`: cached structured snapshots per topic.
263+
* `analysis/`: analyzer outputs (JSON + HTML report).
264+
* `notes/`: JSON-LD Community Notes and index metadata.
261265

262266
### Local development
263267

@@ -288,23 +292,23 @@ run citation checks against Grokipedia references.
288292

289293
#### Build and test
290294

291-
- Build:
295+
* Build:
292296

293297
```bash
294298
npm run build
295299
```
296300

297-
- Run tests:
301+
* Run tests:
298302

299303
```bash
300304
npm test
301305
```
302306

303307
#### Debugging
304308

305-
- `Analysis not found`: check `data/wiki` and `data/grok` for missing
309+
* `Analysis not found`: check `data/wiki` and `data/grok` for missing
306310
snapshots; rerun `gwaln fetch`.
307-
- `Publish timeout`: increase `publishMaxRetries` or verify the DKG node
311+
* `Publish timeout`: increase `publishMaxRetries` or verify the DKG node
308312
endpoint is reachable; use `--dry-run` to ensure the payload is valid
309313
before retrying.
310314

SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
If you discover a security vulnerability in this package, please report it by emailing **abaris@null.net**. Please do not disclose the vulnerability publicly until we have had a chance to address it.
66

77
### Steps to Report:
8+
89
1. Provide a detailed description of the vulnerability.
910
2. Include steps to reproduce the issue.
1011
3. Suggest possible fixes if applicable.

docs/analyzer-overview.md

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ the internals or explain them to other contributors.
99

1010
### Snapshot fetchers
1111

12-
- `gwaln fetch wiki` downloads the wikitext of a topic using
12+
* `gwaln fetch wiki` downloads the wikitext of a topic using
1313
`?action=raw` and records revision metadata, canonical URLs, and page
1414
languages.
15-
- `gwaln fetch grok` requests the Grokipedia article, converts HTML
15+
* `gwaln fetch grok` requests the Grokipedia article, converts HTML
1616
to Markdown with Turndown, removes Grok-specific header banners, and
1717
retrieves citation metadata through
1818
`https://grokipedia.com/api/page`.
@@ -25,15 +25,15 @@ The CLI stores both outputs under `data/wiki/<topic>.parsed.json` and
2525
The parser converts each source into a shared `StructuredArticle`
2626
representation:
2727

28-
- Lead and section blocks with identifiers, anchor names, levels, and
28+
* Lead and section blocks with identifiers, anchor names, levels, and
2929
parent references.
30-
- Sentences with normalized text, token lists, citation/media references,
30+
* Sentences with normalized text, token lists, citation/media references,
3131
and backreferences to claim records.
32-
- Claims (one per sentence) that capture entity labels, normalized
32+
* Claims (one per sentence) that capture entity labels, normalized
3333
numbers, optional time hints, and supporting citations.
34-
- Media registry entries (title, caption, alt text, usage context, and
34+
* Media registry entries (title, caption, alt text, usage context, and
3535
license placeholders).
36-
- Reference store entries built from `<ref>` tags, Markdown links, and
36+
* Reference store entries built from `<ref>` tags, Markdown links, and
3737
Grokipedia API citations.
3838

3939
The parser also removes leftover Grok header sentences to keep the
@@ -48,15 +48,15 @@ content scientific.
4848
3. The analyzer records total missing and extra sentences, while showing
4949
only the first five snippets for readability.
5050
4. **Similarity metrics:**
51-
- **Word similarity:** Token overlap ratio between the two texts,
51+
* **Word similarity:** Token overlap ratio between the two texts,
5252
measuring vocabulary overlap. This calculates how many words are
5353
shared between Wikipedia and Grokipedia regardless of sentence
5454
structure.
55-
- **Sentence similarity:** Proportion of matching sentences,
55+
* **Sentence similarity:** Proportion of matching sentences,
5656
combining identical sentences (full weight) and reworded
5757
sentences (50% weight). This measures structural alignment at the
5858
sentence level.
59-
- **N-gram overlap:** Uses shingle size 4 to capture contiguous
59+
* **N-gram overlap:** Uses shingle size 4 to capture contiguous
6060
phrase matches.
6161

6262
### Understanding similarity metrics
@@ -72,8 +72,9 @@ phrased distinctly.
7272

7373
**Sentence similarity** measures structural alignment—how many complete
7474
sentences match between sources. This metric counts:
75-
- Identical sentences at full weight (1.0)
76-
- Reworded sentences at half weight (0.5)
75+
76+
* Identical sentences at full weight (1.0)
77+
* Reworded sentences at half weight (0.5)
7778

7879
A low sentence similarity (e.g., 0.2%) despite high word similarity
7980
reveals that sources cover the same topic but express information
@@ -90,30 +91,30 @@ sentence pairs.
9091

9192
### Alignment helpers (`src/lib/alignment.ts`)
9293

93-
- **Sections:** headings are compared with cosine similarity
94+
* **Sections:** headings are compared with cosine similarity
9495
(`string-similarity`). Matches above 0.7 get linked; unmatched headers
9596
become missing/extra sections.
96-
- **Claims:** sentence text uses the same cosine check with a 0.65
97+
* **Claims:** sentence text uses the same cosine check with a 0.65
9798
threshold. Unmatched Grok claims indicate hallucinations. Unmatched
9899
Wiki claims indicate missing context.
99100

100101
### Discrepancy detection (`src/lib/discrepancies.ts`)
101102

102-
- **Numeric differences:** the analyzer compares the first number in each
103+
* **Numeric differences:** the analyzer compares the first number in each
103104
aligned claim and flags deviations when
104105
`|a - b| / max(|a|, |b|)` exceeds 5% and units match.
105-
- **Entity differences:** normalized entity sets (trimmed, lowercase) are
106+
* **Entity differences:** normalized entity sets (trimmed, lowercase) are
106107
compared using symmetric difference to catch missing actors or places.
107-
- **Media and citation differences:** set comparisons reveal files or
108+
* **Media and citation differences:** set comparisons reveal files or
108109
URLs present in only one source.
109110

110111
### Bias and hallucination cues
111112

112-
- MOS "words to watch" trigger events only when Grokipedia uses the term
113+
* MOS "words to watch" trigger events only when Grokipedia uses the term
113114
and Wikipedia does not.
114-
- Subjectivity and polarity deltas come from token ratios in
115+
* Subjectivity and polarity deltas come from token ratios in
115116
`src/lib/bias-metrics.ts`.
116-
- Optional verification hooks call Gemini to cross-check bias events and
117+
* Optional verification hooks call Gemini to cross-check bias events and
117118
confirm whether extra sentences cite valid references.
118119

119120
### Diff and highlights
@@ -126,35 +127,35 @@ HTML views.
126127

127128
Analyzer results land in the `gwaln.analysis/2` schema. Each JSON file includes:
128129

129-
- **Stats:** character counts, sentence totals, and missing/extra counts.
130-
- **Similarity ratios:** structured as an object containing:
131-
- `word`: vocabulary overlap ratio (0.0 to 1.0)
132-
- `sentence`: sentence-level match ratio (0.0 to 1.0)
133-
- Alignment arrays for sections and claims with similarity scores.
134-
- Numeric and entity discrepancy lists.
135-
- Bias metrics, bias/hallucination events, diff samples, and optional
130+
* **Stats:** character counts, sentence totals, and missing/extra counts.
131+
* **Similarity ratios:** structured as an object containing:
132+
* `word`: vocabulary overlap ratio (0.0 to 1.0)
133+
* `sentence`: sentence-level match ratio (0.0 to 1.0)
134+
* Alignment arrays for sections and claims with similarity scores.
135+
* Numeric and entity discrepancy lists.
136+
* Bias metrics, bias/hallucination events, diff samples, and optional
136137
verifier responses.
137-
- Confidence labels derived from word similarity and discrepancy density.
138+
* Confidence labels derived from word similarity and discrepancy density.
138139

139140
### Caching
140141

141142
Each run records the analyzer version, shingle size, and cache TTL.
142143
`analysis/<topic>.json` files are cached through
143144
`src/shared/analysis-cache.ts`. Entries stay "fresh" when:
144145

145-
- the `content_hash` (based on a MediaWiki-style hash of the combined
146+
* the `content_hash` (based on a MediaWiki-style hash of the combined
146147
wiki and Grok text) matches the current sources, and
147-
- the timestamp falls within the TTL (72 hours by default).
148+
* the timestamp falls within the TTL (72 hours by default).
148149

149150
When either condition fails, the analyzer recomputes the report.
150151

151152
## Presentation and publishing
152153

153-
- `gwaln show` prints a terminal summary and can open an HTML
154+
* `gwaln show` prints a terminal summary and can open an HTML
154155
dashboard that surfaces the same metrics in a flat layout.
155-
- `gwaln notes build` generates JSON-LD ClaimReviews with annotation
156+
* `gwaln notes build` generates JSON-LD ClaimReviews with annotation
156157
targets referencing both sources.
157-
- `gwaln notes publish` signs and uploads the ClaimReview to the
158+
* `gwaln notes publish` signs and uploads the ClaimReview to the
158159
OriginTrail DKG, records the returned UAL, and logs publish details.
159160

160161
## Typical workflow

0 commit comments

Comments
 (0)