Skip to content

fix(security): harden checksum, pin CDN with SRI, cleanup dead code#32

Merged
shantoislamdev merged 6 commits into
mainfrom
fix/security-and-cleanup
May 27, 2026
Merged

fix(security): harden checksum, pin CDN with SRI, cleanup dead code#32
shantoislamdev merged 6 commits into
mainfrom
fix/security-and-cleanup

Conversation

@shantoislamdev

Copy link
Copy Markdown
Owner

Summary

Security hardening, extensibility fix, and dead code cleanup across 12 files.

Security Fixes (HIGH)

Fix File Impact
Checksum hard-fail
pm/scripts/postinstall.js Tampered binaries no longer install silently
Pin CDN + SRI website/index.html Lucide pinned to v1.16.0 with SHA-384 integrity hash

Extensibility Fixes (HIGH/MEDIUM)

Fix File Impact
Remove provider type gate internal/config/loader.go Custom providers now work via \RegisterFactory()\
Wire \Validate()\ internal/cli/root.go Invalid configs caught at startup, not runtime

Code Cleanup (MEDIUM/LOW)

Fix File Impact
Remove duplicate resume validation internal/cli/generate.go Generator already validates; 20 lines removed
Remove dead code 5 files \StreamChunk, \ErrKindQuota, \ErrKindContentFilter, \Duration.MarshalYAML(), global \Register()/\RegisterFactory()\
Example config fix examples/kothaset.yaml Remove unsupported \logging:\ block
verbose/quiet exclusion internal/cli/root.go Cobra's built-in mutual exclusion

Verification

  • \go build ./...\ passes
  • \go test ./...\ passes
  • \go vet ./...\ passes

…eanup dead code

Security fixes:
- npm postinstall: checksum verification now hard-fails instead of warning,
  preventing tampered binaries from installing silently
- website: pin Lucide to v1.16.0 with SHA-384 SRI hash to prevent CDN compromise

Extensibility fixes:
- config loader: remove hard-rejection of non-'openai' provider types,
  allowing custom providers via RegisterFactory()
- cli: wire Config.Validate() into initConfig() to catch invalid configs early

Cleanup:
- remove duplicate resume validation from CLI (generator already validates)
- remove dead code: StreamChunk struct, ErrKindQuota, ErrKindContentFilter,
  Duration.MarshalYAML(), global Register/RegisterFactory functions
- remove unsupported 'logging:' section from example config
- add --verbose/--quiet mutual exclusion via cobra

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60bfdff7a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cli/root.go Outdated
Comment thread npm/scripts/postinstall.js
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 27, 2026

Copy link
Copy Markdown

Deploying kothaset with  Cloudflare Pages  Cloudflare Pages

Latest commit: 510ecf5
Status: ✅  Deploy successful!
Preview URL: https://8a04de7e.kothaset.pages.dev
Branch Preview URL: https://fix-security-and-cleanup.kothaset.pages.dev

View logs

Validate() in initConfig() caused commands like 'validate config' and
'schema list' to fail when an invalid kothaset.yaml existed in the cwd.
Move validation into runGenerate() where a usable runtime config is
actually required.
A missing entry in checksums.txt (from omission or tampering) now
throws instead of warning, preventing unverified binaries from
installing silently.
@shantoislamdev

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37ea780a47

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cli/generate.go Outdated
- Apply gofmt to all Go files
- Use fmt.Fprintf instead of WriteString(fmt.Sprintf) in classification.go and preference.go
cfg.Validate() checked raw kothaset.yaml values before CLI overrides
were merged, causing commands like 'generate --schema chat' to fail
when the config contained a different schema. All fields are already
validated individually after resolution (schema.Get, GetProvider, etc).
@shantoislamdev shantoislamdev merged commit 006cb6d into main May 27, 2026
6 checks passed
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