Skip to content

Comments

Sean parent/algorithms#44

Open
sean-parent wants to merge 15 commits intomainfrom
sean-parent/algorithms
Open

Sean parent/algorithms#44
sean-parent wants to merge 15 commits intomainfrom
sean-parent/algorithms

Conversation

@sean-parent
Copy link
Member

@sean-parent sean-parent commented Feb 20, 2026

Note

Low Risk
Primarily documentation/content and developer tooling changes; minimal impact outside mdBook rendering and edit-link behavior.

Overview
Adds a new Algorithms chapter to the better-code mdBook, and wires it into the table of contents via better-code/src/SUMMARY.md.

Updates book configuration by fixing the HTML edit-url-template path, and adds a MathJax pre-config (better-code/js/mathjax-config.js) to force TeX webfonts.

Also includes new editor-only repo config: expanded VS Code settings (cSpell dictionary + CMake ignore) and a VS Code task to open the current file in Notepad.

Written by Cursor Bugbot for commit cd58714. This will update automatically on new commits. Configure here.

Rewrite and clarify chapter-4-algorithms.md: improve prose, reorganize examples, and expand the discussion of loop invariants, termination and postconditions. Add a generic Swift halfStablePartition implementation and update removeAllSelected to use it; include usage example and additional notes on rotations, slide/gather composition, and algorithmic tradeoffs. Minor formatting and comment cleanup throughout the file and append extra efficiency bullets. Also add "Subrange" to the VS Code spelling/settings list in .vscode/settings.json.
Clean up chapter-4-algorithms.md by removing an inline partition comment and a short usage example for halfStablePartition. This trims redundant explanatory lines while leaving the function implementation unchanged.
"problemMatcher": []
}
]
} No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personal VS Code task file accidentally committed

Low Severity

A .vscode/tasks.json file defining an "Open in Notepad" shell task was added to the repository. This appears to be a personal developer configuration rather than a project-level resource. The .gitignore does not exclude .vscode/, so this file will be tracked for all contributors.

Fix in Cursor Fix in Web

https://link.springer.com/chapter/10.1007/11786160_8
link.springer.com

https://lamport.azurewebsites.net/pubs/abadi-composing.pdf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unformatted draft notes committed in safety appendix

Low Severity

The safety appendix contains raw, unformatted reference notes after the horizontal rule — bare URLs, document titles, and domain names (lines 68–82) that appear to be research scratch notes rather than finished content. These will render as visible plaintext in the published book.

Fix in Cursor Fix in Web

imageFont: null
}
});
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MathJax config file is unused and never loaded

Low Severity

mathjax-config.js configures MathJax v2 (MathJax.Hub), but the project uses mdbook-katex for math rendering, and book.toml has no additional-js entry to load this file. It will never execute. Having a MathJax config in a KaTeX-based project could mislead future contributors about which math renderer is in use.

Fix in Cursor Fix in Web

Rename footnote identifier from [^operation costs] to [^operation-costs] to match the reference and ensure the footnote link resolves correctly in the algorithms chapter.
- time
- space (memory)
- energy
- computational (number of ALUs in use)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Draft notes and AI-generated content accidentally included

High Severity

Everything from line 304 onwards is explicitly marked as # From here down are notes and experiments, followed by rough outlines and an HTML comment stating This is my outline with AI generated wording. Its generally horrible. This draft content, including duplicate headings, skeletal notes, and unfinished sections, would render visibly in the published book.

Fix in Cursor Fix in Web

Insert an HTML TODO-style note calling out the need to discuss strict-weak vs total-preorder from the contracts chapter, and remove an inline "// lower bound?" comment from the Swift example to keep the code example clean. Changes are limited to chapter-4-algorithms.md to flag the conceptual discussion and tidy the sample code.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

- [Introduction](./chapter-1-introduction.md)
- [Contracts](./chapter-2-contracts.md)
- [Errors](./chapter-3-errors.md)
- [Algorithms](./chapter-4-algorithms.md)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New chapter duplicates existing chapter-4 numbering in filename

Medium Severity

The new Algorithms entry links to chapter-4-algorithms.md while the existing Types entry still links to chapter-4-types.md. The sequential chapter numbering scheme (1-introduction, 2-contracts, 3-errors) is broken — Types is now effectively chapter 5 in order but still named chapter 4, which creates a confusing inconsistency. The edit-url-template in book.toml relies on file paths, so references to the Types chapter by its old number will also be misleading.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant