Skip to content

Conversation

@karmaniverous
Copy link
Owner

  • [10] docs: clarify facets flags and diff anchors
  • [10] fix: facet flags + diff anchors; add regressions
  • [10] Fix facets parse test lint + assertion
  • [10] Update dev plan after green lint/test
  • [10] Add diff anchor changed-only integration test
  • [10] Add TypeDoc comments for exported types
  • [10] docs(typedoc): export ScriptObject type
  • [10] renamed docs-src -> guides
  • [10] docs: add stan assistant guide
  • [10] docs: refresh guides and cross-links
  • [10] updated typedoc

When: 2025-12-29
Why: Commander parsing shows -FS is treated as -F S when -F accepts
     optional args, and --no-facets is stored as facets=false (source=cli),
     causing overlay enablement and script selection to misbehave.
What changed:
- .stan/system/stan.requirements.md: update facet flag semantics (boolean
  -f/-F + explicit --facets-on/off), define explicit-wins ramp-up rule, and
  require DIFF to honor anchors while remaining changed-only.
- .stan/system/stan.todo.md: add concrete implementation plan for fixing
  flag parsing, overlay resolution, and diff anchor behavior with tests/docs.
When: 2025-12-29T00:00:00Z
Why: Commander option bundling and negation shape caused -FS and --no-facets
     to behave incorrectly, and DIFF archives were not honoring anchors.

What changed:
- src/cli/run/options.ts: make -f/-F boolean-only; add --facets-on/off flags
  and conflict rules
- src/cli/run/action/overlay-flow.ts: correctly interpret --no-facets as
  opts.facets=false with source=cli; wire facets-on/off overrides
- src/cli/run/action/overlay.ts: map overlay excludes only when overlay enabled
- src/runner/overlay/facets.ts: Option Y (explicit off wins) and anchor
  .docs.meta.json
- src/runner/overlay/facets.test.ts: update expectations; add explicit-off test
- src/runner/run/session/archive-stage/config.ts (+test): pass anchors into DIFF
- src/cli/run/facets.flags.parse.test.ts: regressions for -FS and --no-facets
- docs-src/*: update docs to match new facet flags and diff anchor policy
- .stan/system/stan.todo.md: record completed work and remaining follow-through
When: 2025-12-29T00:00:00Z
Why: Lint fails due to unsafe any/require-await in facets flag regression test,
     and the test expected an outdated plan-only message string.
What changed:
- src/cli/run/facets.flags.parse.test.ts: remove async-without-await mocks,
  eliminate any/unsafe calls by typing makeCli() as Commander Command, and
  accept current "no scripts selected" plan-only message.
- .stan/system/stan.todo.md: update Next up and append an amendment entry.
When: 2025-12-29T00:00:00Z
Why: All checks are now passing; the plan should reflect the new baseline
     and focus on remaining docs/coverage follow-ups.
What changed:
- .stan/system/stan.todo.md: remove stale “fix lint/test fallout” and
  “tsdoc warning spam” next steps; append completion note.
When: 2025-12-29T00:00:00Z
Why: We need a regression that proves anchors are honored by DIFF without
     breaking the “changed-only vs snapshot” contract, including for
     gitignored-but-important state like facet.state.json.
What changed:
- src/runner/run/archive/diff.anchors.changed-only.integration.test.ts:
  add an integration test that parses archive.diff.tar entries and asserts
  anchored gitignored files appear only when changed vs the snapshot.
- .stan/system/stan.todo.md: record completion and update next steps.
When: 2025-12-29T00:00:00Z
Why: typedoc is configured with validation.notDocumented=true and currently
     warns on several exported types/properties in the public API.
What changed:
- src/cli/config/schema.ts: document ScriptEntry/ScriptObject/ScriptMap so
  typedoc does not emit "not documented" warnings for script config types.
- src/runner/run/types.ts: document RunnerConfig and RunBehavior and their
  properties so typedoc output is clean.
- .stan/system/stan.todo.md: append completion entry for this docs cleanup.
Why: Typedoc warned that ScriptObject is referenced by ScriptEntry but
not included in the generated documentation.

What changed:
- src/index.ts: re-export ScriptObject alongside ScriptEntry/ScriptMap
- .stan/system/stan.todo.md: append Completed note for the docs fix
When: 2025-12-29
Why: Provide a self-contained integration/usage contract for STAN assistants
     per the repository policy.
What changed:
- guides/stan-assistant-guide.md: new assistant-facing usage guide
- .stan/system/stan.todo.md: append completed entry for the guide
When: 2025-12-29
Why: Bring documentation in line with current CLI behavior and
     namespaced configuration; improve navigation with cross-links.
What changed:
- README.md: fix LICENSE link, add FAQ/bootloader links, clarify filenames
- contributing.md: fix clone directory name
- guides/*: align config examples, patch diagnostics, and cross-link guides
- guides/bootloader.md: new bootloader/assistant setup guide
- typedoc.json: include missing guide documents
- .stan/system/stan.todo.md: log documentation pass
Copilot AI review requested due to automatic review settings December 29, 2025 10:00
@karmaniverous karmaniverous merged commit 72bfb3d into main Dec 29, 2025
5 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes bug #10 where facet changes were not properly reflected in archives. The changes introduce a breaking redesign of the facet CLI flags to improve clarity and correctness, ensure diff archives honor anchors with changed-only semantics, and add comprehensive documentation and test coverage.

Key changes:

  • Breaking change: Facet flags now use -f/--facets and -F/--no-facets as boolean toggles (no arguments), with new --facets-on <names...> and --facets-off <names...> flags for per-run overrides
  • Diff archives now properly honor anchors with changed-only semantics (anchored files only appear when changed vs snapshot)
  • Added "Option Y" logic: explicit per-run deactivations (--facets-off) prevent auto-suspension safety checks
  • Documentation reorganization: renamed docs-src/ to guides/ and added comprehensive cross-linking and new assistant guide

Reviewed changes

Copilot reviewed 40 out of 43 changed files in this pull request and generated no comments.

Show a summary per file
File Description
typedoc.json Updated project documents paths from docs-src/ to guides/, added new guide files, enabled notDocumented validation
tsdoc.json Removed unused @jsx tag definition
stan.config.yml Changed default facets: false, updated lint script to object form with warnPattern, simplified imports
src/runner/snap/context.ts Code formatting cleanup (multiline import statement)
src/runner/run/types.ts Added comprehensive TypeDoc comments for exported types (RunnerConfig, RunBehavior)
src/runner/run/session/archive-stage/config.ts Added anchors field to diff config so diff archives honor anchors (changed-only via snapshot)
src/runner/run/session/archive-stage/config.test.ts New test verifying anchors are passed through to both full and diff configs
src/runner/run/archive/diff.anchors.changed-only.integration.test.ts New integration test proving anchored gitignored files only appear in diff when changed
src/runner/overlay/facets.ts Added explicit per-run deactivation tracking and Option Y logic (no auto-suspend for explicit --facets-off), anchored .docs.meta.json
src/runner/overlay/facets.test.ts Updated tests for new .docs.meta.json anchor and added test for explicit deactivation behavior
src/index.ts Added ScriptObject to exports for complete TypeDoc documentation
src/cli/run/options.ts Breaking change: redesigned facet flags to boolean toggles with separate --facets-on/--facets-off override flags
src/cli/run/facets.flags.parse.test.ts New tests for -FS flag parsing and --no-facets overlay disablement
src/cli/run/action/scripts.ts Code formatting cleanup (multiline import statement)
src/cli/run/action/overlay.ts Simplified overlay mapping logic (removed complex conditional that's no longer needed)
src/cli/run/action/overlay-flow.ts Refactored to handle new boolean facet flags with separate per-run override options
src/cli/config/schema.ts Added comprehensive TypeDoc comments for ScriptObject, ScriptEntry, and ScriptMap types
package.json Updated dependencies including stan-core to ^0.4.7 and various dev dependencies
guides/ (multiple files) Renamed from docs-src/, updated documentation to reflect facet flag changes, added cross-links, added new assistant guide
docs-src/ (multiple files) Deleted old documentation directory (renamed to guides/)
.stan/system/stan.todo.md Updated development plan reflecting completed work
.stan/system/stan.requirements.md Updated requirements to document new facet flag behavior and diff anchor policy
.stan/system/facet.meta.json Updated docs facet to use guides/** instead of docs-src/**
.stan/imports/stan-core/ Updated imported stan-core documentation
contributing.md Fixed typo: cd stancd stan-cli
README.md Updated documentation links from docs-src/ to guides/, fixed LICENSE link from LICENSE.md to LICENSE

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @karmaniverous, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a crucial bugfix related to how facet enablement changes are reflected in archives, alongside a significant overhaul of the CLI's facet flag system. It introduces a refined diff archive anchor policy, ensuring that important, often-ignored files are correctly included in diffs when modified. Complementing these functional changes, the project's documentation has undergone a major restructuring and expansion, providing clearer guidance for users and AI assistants alike. These updates collectively enhance the reliability, clarity, and maintainability of the system.

Highlights

  • Facet Flag Redesign and Fixes: The CLI's facet flags (-f, -F, --facets-on, --facets-off) have been redesigned. -f and -F are now boolean flags for enabling/disabling the overlay, while --facets-on and --facets-off provide per-run overrides. This update includes fixes to ensure facet enablement is correctly reflected in archives and that explicit deactivations are respected, preventing unintended auto-suspension.
  • Diff Archive Anchor Policy: A critical bug has been addressed where changes to anchored files (e.g., facet.state.json, .docs.meta.json), even if gitignored, were not consistently appearing in diff archives. Now, anchored files are included in diff archives only when they have changed relative to the snapshot baseline, ensuring accurate representation of state changes.
  • Documentation Restructuring and New Guides: The entire documentation structure has been refactored, with the docs-src directory renamed to guides. All internal links have been updated. A new comprehensive 'STAN assistant guide' has been added, alongside a 'Bootloader & Assistant Setup' guide, to clarify integration and usage for AI assistants.
  • TypeDoc and Linting Improvements: TypeDoc comments have been added for various exported types, and the ScriptObject type is now explicitly exported to enhance generated documentation. Linting issues related to facet flag parsing and TSDoc syntax have also been resolved.
  • Dependency Updates: Numerous project dependencies have been updated to their latest versions, ensuring compatibility, security, and performance improvements across the codebase.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a significant and valuable set of changes. The core bugfix, which ensures facet changes and anchors are correctly reflected in diff archives, is well-implemented and tested. The accompanying breaking change to the facet CLI flags is clearly documented, and the new flags provide a more explicit and less ambiguous user experience. The extensive documentation overhaul, including the move from docs-src to guides and the addition of new, detailed guides, greatly improves the project's usability and maintainability. The code is cleaner with added TSDoc comments and new tests that cover the new logic and prevent regressions. Overall, this is a high-quality contribution. I have a couple of minor suggestions for documentation cleanup.

- Add integration test proving anchored gitignored state appears in diff only when changed vs snapshot.
- Add missing TypeDoc comments for exported config/run types (silence `notDocumented` warnings).
- Export `ScriptObject` from `src/index.ts` so TypeDoc includes it when documenting `ScriptEntry`.
- Add `guides/stan-assistant-guide.md` (assistant integration guide).- Documentation pass: align guides with namespaced config, diagnostics, and add cross-links.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

It looks like there might be a formatting issue on this line, possibly from a copy-paste. The ).- part and the trailing \ No newline at end of file text seem unintentional. I'd suggest splitting this into two separate list items for clarity.

Suggested change
- Add `guides/stan-assistant-guide.md` (assistant integration guide).- Documentation pass: align guides with namespaced config, diagnostics, and add cross-links.
- Add `guides/stan-assistant-guide.md` (assistant integration guide).
- Documentation pass: align guides with namespaced config, diagnostics, and add cross-links.

# STAN — STAN Tames Autoregressive Nonsense

[![npm version](https://img.shields.io/npm/v/@karmaniverous/stan-cli.svg)](https://www.npmjs.com/package/@karmaniverous/stan-cli) ![Node Current](https://img.shields.io/node/v/@karmaniverous/stan-cli) <!-- TYPEDOC_EXCLUDE --> [![docs](https://img.shields.io/badge/docs-website-blue)](https://docs.karmanivero.us/stan) [![changelog](https://img.shields.io/badge/changelog-latest-blue.svg)](https://github.com/karmaniverous/stan-cli/tree/main/CHANGELOG.md)<!-- /TYPEDOC_EXCLUDE --> [![license](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](https://github.com/karmaniverous/stan-cli/tree/main/LICENSE.md)
[![npm version](https://img.shields.io/npm/v/@karmaniverous/stan-cli.svg)](https://www.npmjs.com/package/@karmaniverous/stan-cli) ![Node Current](https://img.shields.io/node/v/@karmaniverous/stan-cli) <!-- TYPEDOC_EXCLUDE --> [![docs](https://img.shields.io/badge/docs-website-blue)](https://docs.karmanivero.us/stan) [![changelog](https://img.shields.io/badge/changelog-latest-blue.svg)](https://github.com/karmaniverous/stan-cli/tree/main/CHANGELOG.md)<!-- /TYPEDOC_EXCLUDE --> [![license](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](https://github.com/karmaniverous/stan-cli/tree/main/LICENSE)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The link to the license file appears to have been broken in this change. It was modified from LICENSE.md to LICENSE. Please verify the correct filename and update the link accordingly. It's likely it should be LICENSE.md.

Suggested change
[![npm version](https://img.shields.io/npm/v/@karmaniverous/stan-cli.svg)](https://www.npmjs.com/package/@karmaniverous/stan-cli) ![Node Current](https://img.shields.io/node/v/@karmaniverous/stan-cli) <!-- TYPEDOC_EXCLUDE --> [![docs](https://img.shields.io/badge/docs-website-blue)](https://docs.karmanivero.us/stan) [![changelog](https://img.shields.io/badge/changelog-latest-blue.svg)](https://github.com/karmaniverous/stan-cli/tree/main/CHANGELOG.md)<!-- /TYPEDOC_EXCLUDE --> [![license](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](https://github.com/karmaniverous/stan-cli/tree/main/LICENSE)
[![npm version](https://img.shields.io/npm/v/@karmaniverous/stan-cli.svg)](https://www.npmjs.com/package/@karmaniverous/stan-cli) ![Node Current](https://img.shields.io/node/v/@karmaniverous/stan-cli) <!-- TYPEDOC_EXCLUDE --> [![docs](https://img.shields.io/badge/docs-website-blue)](https://docs.karmanivero.us/stan) [![changelog](https://img.shields.io/badge/changelog-latest-blue.svg)](https://github.com/karmaniverous/stan-cli/tree/main/CHANGELOG.md)<!-- /TYPEDOC_EXCLUDE --> [![license](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](https://github.com/karmaniverous/stan-cli/tree/main/LICENSE.md)

```bash
git clone https://github.com/karmaniverous/stan-cli.git
cd stan
cd stan-cli
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This is a great fix! Correcting the directory path in the setup instructions is crucial for a smooth onboarding experience for new contributors.

Comment on lines +4 to 7
/** Build FULL and DIFF base configs; DIFF honors anchors (changed-only via snapshot). */
export const makeBaseConfigs = (
config: RunnerConfig,
): {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change to include anchors in the diff configuration is the core of the bugfix and correctly addresses the issue of facet changes not being reflected in the diff archive. The updated comment also clearly reflects the new behavior. Excellent work.

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.

2 participants