diff --git a/.config/tracey/config.styx b/.config/tracey/config.styx deleted file mode 100644 index d94a021e..00000000 --- a/.config/tracey/config.styx +++ /dev/null @@ -1,14 +0,0 @@ -specs ( - { - name bough - include ( crates/**/*SPEC*.md ) - impls ( - { - name rust - include (crates/**/*.rs) - exclude (target/**) - } - ) - } - -) diff --git a/TODO.spec-issues.md b/TODO.spec-issues.md deleted file mode 100644 index 2c7d3bb9..00000000 --- a/TODO.spec-issues.md +++ /dev/null @@ -1,27 +0,0 @@ -# Spec Issues to Resolve - -## Return types - -### `base.mutants` / `base.mutations` -Spec says `Base::mutants(language_id: &LanguageId) -> MutantsIter` but `MutantsIter` is per-file (holds single `&Twig`). `Base::mutants` needs to iterate across all files for a language. - -Options: -- a) Return `impl Iterator>` — simple, but doesn't match spec signature -- b) Rework `MutantsIter` to support multiple twigs — changes existing type -- c) Create a new `BaseMutantsIter` wrapper — matches spirit but not letter of spec - -Same issue applies to `Base::mutations` / `MutationIter`. - -## Skip config - -### `mutant.iter.skip.kind` / `mutant.iter.skip.kind.multiple` -Where does the skip config live? Options: -- a) Additional params to `MutantsIter::new()` -- b) Builder pattern on `MutantsIter` -- c) Config struct passed in - -### `mutant.iter.skip.query` / `mutant.iter.skip.query.multiple` -"ts lisp-style query" — assumed to be tree-sitter S-expression queries. Clarify: -- Does the query match against the mutant's own node? -- Or against the mutant's parent/ancestor context? -- How does it interact with the tree — do we need to retain the parsed tree in `MutantsIter` (currently discarded after `walk_tree`)? diff --git a/crates/bough-cli/Config_SPEC.md b/crates/bough-cli/Config_SPEC.md deleted file mode 100644 index d3c94370..00000000 --- a/crates/bough-cli/Config_SPEC.md +++ /dev/null @@ -1,44 +0,0 @@ -## Config - -bough[config.include.at-least-one] -cli must have at least 1 include path - -bough[config.exclude.from-vcs-ignore] -Config::get_base_exclude-globs must include all globs from all vcs ignore files that would be picked up by a vcs in base dir - -bough[config.lang.exclude.from-vcs-ignore] -Config::get_lang_exclude-globs must include all globs from all vcs ignore files that would be picked up by a vcs in base dir - -bough[config.exclude.from-vcs-dir] -Config::get_base_exclude-globs must include all vcs dirs - -bough[config.lang.exclude.from-vcs-dir] -Config::get_lang_exclude-globs must include all vcs dirs - -bough[config.exclude.bough-dir] -Config::get_base_exclude_globs must include a matcher for the current bough_dir - -bough[config.lang.exclude.bough-dir] -Config::get_lang_exclude_globs must include a matcher for the current bough_dir - -bough[config.lang.exclude.derived] -Config::get_lang_exclude_globs must include all exclude paths from Config::get_base_exclude_globs - -bough[config.lang.include.derived] -Config::get_lang_include_globs must not include include paths from Config::get_base_include_globs - -bough[config.base-root-path+2] -`Config::get_base_root_path` should be set from a value in the config file (Config::base_root_path: PathBuf) - -bough[config.base-root-path.default] -Config::base_root_path is required, no default - -bough[config.base-root-path.absolutized-relative-to-file] -Once the config has been resolved and parsed, the base_root_path should be absolutized relative to the directory containing the resolved config file. - -Eg, if a config file contained `base_root_path = "./qux"`, and was found in `/foo/bar/config.toml`, the resolved value should be /foo/bar/qux. - -If it was located in `/foo/bar/.config/bough.toml`, that same value would be resolved to /foo/bar/.config/qux, to achieve the same effect you would have to update the file to instead contain "../qux" - -bough[config.base-root-path.relative-via-figue] -the location of the resolved config should be extracted from the figue processing, not calculated separately diff --git a/crates/bough-core/BASE_SPEC.md b/crates/bough-core/BASE_SPEC.md deleted file mode 100644 index 14b04b32..00000000 --- a/crates/bough-core/BASE_SPEC.md +++ /dev/null @@ -1,13 +0,0 @@ -## Base - -bough[base.root] -Base impls Root - - - - - - - - - diff --git a/crates/bough-core/FACET_DISK_STORE_SPEC.md b/crates/bough-core/FACET_DISK_STORE_SPEC.md deleted file mode 100644 index 043f36ae..00000000 --- a/crates/bough-core/FACET_DISK_STORE_SPEC.md +++ /dev/null @@ -1,40 +0,0 @@ -## FacetDiskStore - -bough[fds.type] -`FacetDiskStore` - -bough[fds.keys] -`FacetDiskStore::keys` iterates all keys that have been inserted into it - -bough[fds.keys.invalid] -if `FacetDiskStore::keys` finds an invalidly named file, it should be skipped - -bough[fds.get] -`FacetDiskStore::get(&key) -> Option<&val>` returns val by key - -bough[fds.get.invalid] -if `FacetDiskStore::get(&key)` finds an invalid on-disk file, it should return None - -bough[fds.set] -`FacetDiskStore::get(key, val) -> Result<(), _>` inserts val by key - -bough[fds.remove] -`FacetDiskStore::remove(key) -> Option` removes val by key - -bough[fds.new] -`FacetDiskStore::new(dir: PathBuf) -> Self` points fds at a specified directory - -bough[fds.new.mkdir] -if dir doesn't exist, it should be created - -bough[fds.files] -fds should store all vals on disk at `$dir/$key.json` in json format - -bough[fds.live] -fds should handle all actions by reading/writing disk, and not cache in memory. - -bough[fds.live.intercepted] -if the directory is altered by some other process/function, the most up-to-date state should be refected by fds - -bough[fds.live.startup] -fds should include files that were on disk before it was created diff --git a/crates/bough-core/FILE_SPEC.md b/crates/bough-core/FILE_SPEC.md deleted file mode 100644 index 779c5391..00000000 --- a/crates/bough-core/FILE_SPEC.md +++ /dev/null @@ -1,34 +0,0 @@ -## File - -bough[file.root] -Root Path must be created with an absolute path - -bough[file.twig] -Twig(PathBuf) must be created with a relative path - -bough[file.file] -`pub struct File<'a> { root: &'a Root, twig: &'a Twig, }` - -bough[file.file.resolve] -File::resolve joins root and twig to create the fully resolved path - -bough[file.transplant] -`File::transplant(&self, root: &Root) -> Self` replace root - -bough[twig.iter.root] -TwigsIter holds a ref to a Root - -bough[twig.iter] -TwigsIter impls Iterator - -bough[twig.iter.new] -TwigsIter::new(root: &impl Root) -> Self, uses walkdir to recursively walk root - -bough[twig.iter.include.match] -A file should be yielded only if it matches any of the include patterns - -bough[twig.iter.include.empty] -If no include patterns are configured, no files are yielded - -bough[twig.iter.exclude.match] -A file should be excluded if it matches any of the exclude patterns diff --git a/crates/bough-core/MUTANTS_ITER_SPEC.md b/crates/bough-core/MUTANTS_ITER_SPEC.md deleted file mode 100644 index b79637b5..00000000 --- a/crates/bough-core/MUTANTS_ITER_SPEC.md +++ /dev/null @@ -1,49 +0,0 @@ -## TwigMutantsIter - -bough[mutant.twig-iter] -TwigMutantsIter impls Iterator - -bough[mutant.twig-iter.base] -TwigMutantsIter holds &Base - -bough[mutant.twig-iter.twig] -TwigMutantsIter holds &Twig - -bough[mutant.twig-iter.lang] -TwigMutantsIter owns LanguageId - -bough[mutant.twig-iter.file] -TwigMutantsIter uses base and twig to resolve the absolute path of the file to parse - -bough[mutant.twig-iter.find] -TwigMutantsIter uses its LanguageDriver to walk the parsed tree-sitter AST and find all supported mutants - -bough[mutant.twig-iter.find.js.statement] -TwigMutantsIter finds javascript statement blocks - -bough[mutant.twig-iter.find.js.condition.if] -TwigMutantsIter finds javascript conditions of if statements - -bough[mutant.twig-iter.find.js.condition.while] -TwigMutantsIter finds javascript conditions of while statements - -bough[mutant.twig-iter.find.js.condition.for] -TwigMutantsIter finds javascript conditions of for statements - -bough[mutant.twig-iter.find.js.binary.add] -TwigMutantsIter finds javascript add binary ops - -bough[mutant.twig-iter.find.js.binary.sub] -TwigMutantsIter finds javascript subtract binary ops - -bough[mutant.twig-iter.skip.kind] -TwigMutantsIter::with_skip_kind(self, kind: MutantKind) -> Self skips all mutants of the specified kind - -bough[mutant.twig-iter.skip.kind.multiple] -with_skip_kind can be called multiple times; a mutant is skipped if its kind matches ANY of the configured skip kinds - -bough[mutant.twig-iter.skip.query] -TwigMutantsIter::with_skip_query(self, query: &str) -> Self skips all mutants whose tree-sitter node matches the provided S-expression query - -bough[mutant.twig-iter.skip.query.multiple] -with_skip_query can be called multiple times; a mutant is skipped if its node matches ANY of the configured skip queries diff --git a/crates/bough-core/MUTANT_SPEC.md b/crates/bough-core/MUTANT_SPEC.md deleted file mode 100644 index 591b310e..00000000 --- a/crates/bough-core/MUTANT_SPEC.md +++ /dev/null @@ -1,60 +0,0 @@ -## Mutant - -bough[mutant.lang] -Mutant owns LanguageId - -bough[mutant.twig] -Mutant owns Twig - -bough[mutant.kind] -Mutant owns MutantKind - -bough[mutant.span] -Mutant owns Span - -bough[span.point] -Span is composed of two Points - -bough[point.line] -Point::line is a usize representing the line of the file it points to - -bough[point.col] -Point::col is a usize representing the col of the file it points to - -bough[point.byte] -Point::byte is a usize representing the byte of the file it points to - -bough[mutant.hash.typed-hashable] -Mutant should impl TypedHashable - -bough[mutant.hash.lang] -Mutant hash should include lang - -bough[mutant.hash.twig] -Mutant hash should include twig - -bough[mutant.hash.span] -Mutant hash should include span - -bough[mutant.hash.kind] -Mutant hash should include kind - -## BasedMutant - -bough[mutant.based] -BasedMutant composes Mutant + &Base - -bough[mutant.based.base] -BasedMutant holds &Base - -bough[mutant.based.mutant] -BasedMutant holds Mutant - -bough[mutant.based.hash.typed-hashable] -BasedMutant should impl TypedHashable - -bough[mutant.based.hash.base] -BasedMutant hash MUST NOT include base, if two identical files exist in two different bases, their BasedMutant should hash to the same value - -bough[mutant.based.hash.file] -BasedMutant hash should include the contents of its base + twig File diff --git a/crates/bough-core/MUTATION_ITER_SPEC.md b/crates/bough-core/MUTATION_ITER_SPEC.md deleted file mode 100644 index 526be208..00000000 --- a/crates/bough-core/MUTATION_ITER_SPEC.md +++ /dev/null @@ -1,13 +0,0 @@ -## MutationIter - -bough[mutation.iter.mutant] -MutationIter holds &Mutant - -bough[mutation.iter.mutation] -MutationIter impls Iter - -bough[mutation.iter.language_driver] -MutationIter delegates to LangaugeDriver to produce valid strings to replace Mutant with - -bough[mutation.iter.invalid] -If the Mutant is not syntactically valid for a language (eg, StrictEq '===' in rust), it should produce no Mutations diff --git a/crates/bough-core/MUTATION_SPEC.md b/crates/bough-core/MUTATION_SPEC.md deleted file mode 100644 index 085986b2..00000000 --- a/crates/bough-core/MUTATION_SPEC.md +++ /dev/null @@ -1,31 +0,0 @@ -## Mutation - -bough[mutation.mutant] -Mutation holds &Mutant - -bough[mutation.subst] -Mutation owns a string that the span of it's Mutant could be replaced with in the pointed twig to produce a different syntactically valid program - -bough[mutation.subst.js.add.sub] -If the js Mutant was for '+', there should be a Mutation to replace it with '-' - -bough[mutation.subst.js.add.mul] -If the js Mutant was for '+', there should be a Mutation to replace it with '\*' - -bough[mutation.subst.js.statement] -If the js Mutant was for a statement block, there should be a Mutation to replace it with '{}' - -bough[mutation.subst.js.cond.true] -If the js Mutant was for a condition, there should be a Mutation to replace it with 'true' - -bough[mutation.subst.js.cond.false] -If the js Mutant was for a condition, there should be a Mutation to replace it with 'false' - -bough[mutation.hash.typed-hashable] -Mutant should impl TypedHashable - -bough[mutation.hash.mutant] -Mutation hash should include Mutant - -bough[mutation.hash.subst] -Mutation hash should include subst diff --git a/crates/bough-core/PHASE_SPEC.md b/crates/bough-core/PHASE_SPEC.md deleted file mode 100644 index 22197914..00000000 --- a/crates/bough-core/PHASE_SPEC.md +++ /dev/null @@ -1,47 +0,0 @@ -## Phase - -bough[phase.root] -Phase holds &Root - -bough[phase.pwd] -Phase holds a twig called pwd - -bough[phase.env] -Phase holds a HashMap of env vars to apply - -bough[phase.cmd] -Phase::cmd is a Vec that will be run as a sub process - -bough[phase.timeout] -Phase::timeout is a TimeoutConfig - -bough[phase.run] -`Phase::run() -> Result<_,_>` runs Phase::cmd - -bough[phase.run.pwd] -Phase::run runs the command in File { root, pwd } - -bough[phase.run.env] -Phase::run runs the command with the specified env vars - -bough[phase.run.timeout] -Phase::run stops the command if it extends the provided timeout - -bough[phase.run.timeout.absolute] -Phase::run stops the command if it extends the provided absolute timeout - -bough[phase.run.timeout.relative] -Phase::run takes an optional Duration. it stops the command if this Duration is defined, and it extends the provided relative `timeout * provided_duration` - -bough[phase.out] -`Phase::run -> Result` - -bough[phase.out.stdio] -PhaseOutcome should retain all stdout and stderr from the command - -bough[phase.out.exit] -PhaseOutcome should contain the exit code of the command, non-zero should return Ok(), not Err - -bough[phase.out.duration] -PhaseOutcome should contain the duration time of the command - diff --git a/crates/bough-core/SESSION_SPEC.md b/crates/bough-core/SESSION_SPEC.md deleted file mode 100644 index 075e7fa4..00000000 --- a/crates/bough-core/SESSION_SPEC.md +++ /dev/null @@ -1,34 +0,0 @@ -## Session - -bough[session.init+2] -`Session::::new(config: Config) -> Result` - -bough[session.init.state.attach] -`Session::new` will create a mutations_state pointing at `Config::get_bough_state_dir() + "/state"` - -bough[session.init.state.get] -`Session::get_state()` returns ref to mutations_state - -bough[session.tend.state.add-missing] -`Session::tend_add_missing_states -> Iter` will add any mutations_in_base that are missing to mutations_state, defaulting `outcome` to `None`, it returns the ones it added - -bough[session.tend.state.remove-stale] -`Session::tend_remove_stale_states -> Iter` will remove any mutations_state that are missing from mutations_in_base, it returns the ones it removed. - -bough[session.tend.workspaces] -`Session::tend_workspaces(desired_count) -> Iter` tends workspaces and returns the set of existing ones when it's done - -bough[session.tend.workspaces.bind] -`Session::tend_workspaces` binds to existing workspaces - -bough[session.tend.workspaces.bind.validate-unchanged.rm] -if the bound workspace fails validate_unchanged, it is removed from disk - -bough[session.tend.workspaces.bind.validate-unchanged.forget] -if the bound workspace fails validate_unchanged, the Workspace struct is dropped - -bough[session.tend.workspaces.new] -After binding to clean existing dirs, new ones are created until desired_count is reached - -bough[session.tend.workspaces.surplus] -If more exist on disk than are desired, the surplus are removed diff --git a/crates/bough-core/WORKSPACE_SPEC.md b/crates/bough-core/WORKSPACE_SPEC.md deleted file mode 100644 index c823b31a..00000000 --- a/crates/bough-core/WORKSPACE_SPEC.md +++ /dev/null @@ -1,67 +0,0 @@ -## Workspace - -bough[workspace.root] -Workspace impls Root - -bough[workspace.base] -Workspace holds &Base - -bough[workspace.files] -Workspace::files -> TwigsIter - -bough[workspace.is-handle] -Workspace struct exists as a handle for a directory - -bough[workspace.relationship] -Workspace struct has a 1-to-1 relationship with a workspace directory - -bough[workspace.id] -WorkspaceId is a randomly generated 8 char hex identifier - -bough[workspace.id.is-dir-name] -The directory a Workspace points to must be a valid WorkspaceId - -bough[workspace.id.get] -Workspace::id() -> WorkspaceId - -bough[workspace.new] -`Workspace::new(dir: PathBuf) -> Result` makes a new dir - -bough[workspace.new.dir] -workspace should be created inside the provided dir, in a `work` sub dir - -bough[workspace.new.dir.previous] -if the dir previously existed, that's an error - -bough[workspace.new.from-base-files] -Workspace should be created by copying the matched files of Base::files - -bough[workspace.bind] -`Workplace::bind(dir: PathBuf, id: &WorkspaceId) -> Result` creates a new struct associated with an existing directory - -bough[workspace.bind.validate-unchanged] -Workspace::validate_unchanged() is called after bind to ensure it has not changed - -bough[workspace.validate-unchanged] -Workspace::validate_unchanged() checks that list and file contents of Base::files and Workspace::files are identicall - -bough[workspace.validate-unchanged.untracked] -Workspace::validate_unchanged() doesn't check for equality of files that are not in Base::files; they are allowed to differ, or not be present, in workspaces - -bough[workspace.active] -The stored Workspace active Mutation should be of type Mutation - -bough[workspace.write_mutant] -`Workspace::write(&mut self, ws: &Mutant) -> Result<(), _>` writes the mutated file to the coresponding file in the specified workspace - -bough[workspace.write_mutant.set-active] -`Workspace::write` sets the provided mutant as it's "active" mutant - -bough[workspace.write_mutant.set-active.only-one] -Workspace can only have one active mutant, trying to set multiple results in an error - -bough[workspace.revert_mutant] -`Workspace::revert(&mut self, ws: &Mutant) -> Result<(), _>` reverts the mutated file in the workspace so it is identical to the file in the Base - -bough[workspace.revert_mutant.active] -`Workspace::revert` clears the active mutant