Skip to content

skills/wiki-generator/src/diff

Module summary

Module skills/wiki-generator/src/diff

Exports

NameKindDefault
addEntryfunctionno
detectChangesfunctionno
hashContentfunctionno
hashFilefunctionno
hashModulefunctionno
loadEntriesfunctionno
loadHashesfunctionno
saveEntriesfunctionno
saveHashesfunctionno

Detail

addEntry

async addEntry(stateDir, issueNumber)

Idempotently add an issue number to the persisted set. Returns whether the entry was newly added and the resulting total count.

Params

  • stateDir
  • issueNumber

Returns

None.

Examples

None.

detectChanges

detectChanges(prevHashes, nextHashes)

Compare two file-hash maps and emit added / modified / deleted / renamed entries.

Rename heuristic: a path that disappeared from prev and a path that appeared in next are paired as a rename when their content hashes match exactly. The pairing is one-to-one and greedy by sorted from path so the output is deterministic.

Params

  • prevHashes
  • nextHashes

Returns

None.

Examples

None.

hashContent

hashContent(input)

SHA-256 hex digest over the given content. Buffers and strings are accepted; strings are hashed as UTF-8 bytes (matching the on-disk representation).

Params

  • input

Returns

None.

Examples

None.

hashFile

async hashFile(absPath)

Read a file from disk and return its SHA-256 hex digest.

Params

  • absPath

Returns

None.

Examples

None.

hashModule

hashModule(parts)

Compute the composite SHA-256 module hash from the four input sections. Changing any single section (AST, JSDoc, adjacent README, adjacent comments) produces a different hex digest. Same inputs always produce the same digest.

Params

  • parts

Returns

None.

Examples

None.

loadEntries

async loadEntries(stateDir)

Load the persisted set of documented issue numbers. Returns an empty Set when the state file does not exist.

Params

  • stateDir

Returns

None.

Examples

None.

loadHashes

async loadHashes(stateDir)

Load the persisted file-hash map from <stateDir>/file-hashes.json. Returns an empty object when the file does not yet exist.

Params

  • stateDir

Returns

None.

Examples

None.

saveEntries

async saveEntries(stateDir, set)

Persist the set of documented issue numbers atomically, sorted ascending.

Params

  • stateDir
  • set

Returns

None.

Examples

None.

saveHashes

async saveHashes(stateDir, hashes)

Persist the file-hash map atomically. Keys are sorted alphabetically so the on-disk artifact is deterministic across runs.

Params

  • stateDir
  • hashes

Returns

None.

Examples

None.