Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
52 changes: 26 additions & 26 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ filtering, hibernation (deferred activation of callbacks until a condition is me
resume from a previously interrupted session, concurrent navigation via pants worker pool,
and hook-able traversal behaviour.

- **Module**: `github.com/snivilised/agenor`
- **Package alias**: `age` (import as `age "github.com/snivilised/agenor"`)
- **Docs**: <https://pkg.go.dev/github.com/snivilised/agenor>
- **Module**: `github.com/snivilised/jaywalk`
- **Package alias**: `age` (import as `jw "github.com/snivilised/jaywalk"`)
- **Docs**: <https://pkg.go.dev/github.com/snivilised/jaywalk>

## Build & Test Commands

Expand Down Expand Up @@ -70,10 +70,10 @@ The low-level API composes these explicitly:

```go
// Walk/Prime
age.Walk().Configure().Extent(age.Prime(facade, opts...)).Navigate(ctx)
jw.Walk().Configure().Extent(jw.Prime(facade, opts...)).Navigate(ctx)

// Run/Resume
age.Run(wg).Configure().Extent(age.Resume(facade, opts...)).Navigate(ctx)
jw.Run(wg).Configure().Extent(jw.Resume(facade, opts...)).Navigate(ctx)
```

### Scenario composites
Expand All @@ -92,10 +92,10 @@ lint warnings from bare literals:

```go
const isPrime = true
age.Tortoise(isPrime)(facade, opts...).Navigate(ctx)
jw.Tortoise(isPrime)(facade, opts...).Navigate(ctx)

var wg sync.WaitGroup
age.Hare(isPrime, &wg)(facade, opts...).Navigate(ctx)
jw.Hare(isPrime, &wg)(facade, opts...).Navigate(ctx)
wg.Wait()
```

Expand All @@ -113,12 +113,12 @@ relic := &pref.Relic{...} // resume sessions only

### Enums

All enum values are in the `enums` package. Do not use `age.` prefixed aliases
All enum values are in the `enums` package. Do not use `jw.` prefixed aliases
for enum values - use `enums.` directly:

```go
enums.SubscribeFiles // not age.SubscribeFiles
enums.MetricNoFilesInvoked // not age.MetricNoFilesInvoked
enums.SubscribeFiles // not jw.SubscribeFiles
enums.MetricNoFilesInvoked // not jw.MetricNoFilesInvoked
enums.ResumeStrategyFastward
```

Expand All @@ -128,27 +128,27 @@ Options are passed as variadic `...pref.Option` to `Prime`/`Resume` or to a comp
All `With*` option constructors are re-exported from the root `age` package:

```go
age.WithFilter(...)
age.WithDepth(5)
age.WithOnBegin(handler)
age.WithCPU // use all available CPUs for Run
age.WithNoW(n) // use n workers for Run
jw.WithFilter(...)
jw.WithDepth(5)
jw.WithOnBegin(handler)
jw.WithCPU // use all available CPUs for Run
jw.WithNoW(n) // use n workers for Run
```

Use `age.IfOption` / `age.IfOptionF` / `age.IfElseOptionF` for conditional options.
Use `jw.IfOption` / `jw.IfOptionF` / `jw.IfElseOptionF` for conditional options.

## Key Types

| Type | Package | Purpose |
| --- | --- | --- |
| `age.Node` | `core` | A file system node passed to the client callback |
| `age.Servant` | `core` | Provides the client with traversal properties |
| `age.Client` | `core` | The callback signature: `func(node *age.Node) error` |
| `age.Navigator` | `core` | Returned by `Extent()`; call `.Navigate(ctx)` on it |
| `age.Options` | `pref` | Full options struct available inside `With*` constructors |
| `age.Using` | `pref` | Alias for `pref.Using` (Prime facade) |
| `age.Relic` | `pref` | Alias for `pref.Relic` (Resume facade) |
| `age.TraversalFS` | `tfs` | File system interface required for traversal |
| `jw.Node` | `core` | A file system node passed to the client callback |
| `jw.Servant` | `core` | Provides the client with traversal properties |
| `jw.Client` | `core` | The callback signature: `func(node *jw.Node) error` |
| `jw.Navigator` | `core` | Returned by `Extent()`; call `.Navigate(ctx)` on it |
| `jw.Options` | `pref` | Full options struct available inside `With*` constructors |
| `jw.Using` | `pref` | Alias for `pref.Using` (Prime facade) |
| `jw.Relic` | `pref` | Alias for `pref.Relic` (Resume facade) |
| `jw.TraversalFS` | `tfs` | File system interface required for traversal |

## Internal Packages (do not import directly)

Expand All @@ -163,15 +163,15 @@ Use `age.IfOption` / `age.IfOptionF` / `age.IfElseOptionF` for conditional optio

## Test Helpers

- **`test/hanno`** (`github.com/snivilised/agenor/test/hanno`) - utilities for building
- **`test/hanno`** (`github.com/snivilised/jaywalk/test/hanno`) - utilities for building
virtual file system trees; see `GO-USER-CONFIG.md` for `Nuxx` usage
- **`test/data/musico-index.xml`** - standard XML fixture representing a sample music
directory tree, used by `Nuxx` to populate an in-memory file system
- **`internal/laboratory`** - internal-only test utilities; do not use from outside the module

## i18n

- Translation structs are defined in `github.com/snivilised/agenor/locale`
- Translation structs are defined in `github.com/snivilised/jaywalk/locale`
- Follow the i18n conventions in `GO-USER-CONFIG.md`

## File References
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
[![A B](https://img.shields.io/badge/branching-commonflow-informational?style=flat)](https://commonflow.org)
[![A B](https://img.shields.io/badge/merge-rebase-informational?style=flat)](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)
[![A B](https://img.shields.io/badge/branch%20history-linear-blue?style=flat)](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule)
[![Go Reference](https://pkg.go.dev/badge/github.com/snivilised/agenor.svg)](https://pkg.go.dev/github.com/snivilised/agenor)
[![Go report](https://goreportcard.com/badge/github.com/snivilised/agenor)](https://goreportcard.com/report/github.com/snivilised/agenor)
[![Go Reference](https://pkg.go.dev/badge/github.com/snivilised/jaywalk.svg)](https://pkg.go.dev/github.com/snivilised/jaywalk)
[![Go report](https://goreportcard.com/badge/github.com/snivilised/jaywalk)](https://goreportcard.com/report/github.com/snivilised/jaywalk)
[![Coverage Status](https://coveralls.io/repos/github/snivilised/agenor/badge.svg?branch=main)](https://coveralls.io/github/snivilised/agenor?branch=main&kill_cache=1)
[![Astrolib Continuous Integration](https://github.com/snivilised/agenor/actions/workflows/ci-workflow.yml/badge.svg)](https://github.com/snivilised/agenor/actions/workflows/ci-workflow.yml)
[![Astrolib Continuous Integration](https://github.com/snivilised/jaywalk/actions/workflows/ci-workflow.yml/badge.svg)](https://github.com/snivilised/jaywalk/actions/workflows/ci-workflow.yml)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![A B](https://img.shields.io/badge/commit-conventional-commits?style=flat)](https://www.conventionalcommits.org/)

Expand Down
8 changes: 4 additions & 4 deletions cmd/jay/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

`jay` is a Go CLI application that acts as a companion tool to the `agenor` directory-walking library. It uses `cobra`/`mamba` for the CLI layer and `viper` for configuration management.

- **Repo**: `github.com/snivilised/agenor` (`jay` lives at `cmd/jay` within it)
- **Module**: `github.com/snivilised/agenor` (jay is the CLI frontend, located at `cmd/jay` within the agenor module)
- **Repo**: `github.com/snivilised/jaywalk` (`jay` lives at `cmd/jay` within it)
- **Module**: `github.com/snivilised/jaywalk` (jay is the CLI frontend, located at `cmd/jay` within the agenor module)
- **Entry point for jay**: `./cmd/jay/main.go`

## Build & Test Commands
Expand All @@ -32,7 +32,7 @@ All flags are defined in `cmd/internal/cfg/flags.go`.

## agenor Integration

`jay` uses `agenor` (`github.com/snivilised/agenor`) as its directory-walking backend. Follow these conventions:
`jay` uses `agenor` (`github.com/snivilised/jaywalk`) as its directory-walking backend. Follow these conventions:

- Construct facades as named variables before passing to `Tortoise`/`Hare` - never inline:

Expand All @@ -53,7 +53,7 @@ All flags are defined in `cmd/internal/cfg/flags.go`.

## i18n

- Translation structs are defined in `github.com/snivilised/agenor/locale`
- Translation structs are defined in `github.com/snivilised/jaywalk/locale`
- Follow the i18n conventions in `GO-USER-CONFIG.md`; locale struct placement is per the package above

## File References
Expand Down
2 changes: 1 addition & 1 deletion cmd/jay/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/snivilised/agenor/cmd/command"
"github.com/snivilised/jaywalk/src/app/command"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/snivilised/agenor
module github.com/snivilised/jaywalk

go 1.26.0

Expand Down
2 changes: 1 addition & 1 deletion locale/locale-defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package locale
const (
// SourceID defines the ID (by convention the repo URL) required
// for i18n translation purposes.
SourceID = "github.com/snivilised/agenor"
SourceID = "github.com/snivilised/jaywalk/src/agenor"
)

type agenorTemplData struct{}
Expand Down
4 changes: 2 additions & 2 deletions locale/messages-errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/snivilised/agenor/locale"
"github.com/snivilised/agenor/test/hanno"
"github.com/snivilised/jaywalk/locale"
"github.com/snivilised/jaywalk/src/agenor/test/hanno"
"github.com/snivilised/li18ngo"
)

Expand Down
14 changes: 7 additions & 7 deletions scripts/coverage-exclusion-list.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/snivilised/agenor/enums
github.com/snivilised/agenor/internal/filtering/constant.go
github.com/snivilised/agenor/internal/third
github.com/snivilised/agenor/internal/laboratory
github.com/snivilised/agenor/test/hanno
github.com/snivilised/agenor/test/hydra
github.com/snivilised/agenor/test/cmd
github.com/snivilised/jaywalk/enums
github.com/snivilised/jaywalk/internal/filtering/constant.go
github.com/snivilised/jaywalk/internal/third
github.com/snivilised/jaywalk/internal/laboratory
github.com/snivilised/jaywalk/test/hanno
github.com/snivilised/jaywalk/test/hydra
github.com/snivilised/jaywalk/test/cmd
12 changes: 6 additions & 6 deletions builders.go → src/agenor/builders.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package age
package agenor

import (
"github.com/snivilised/agenor/enums"
"github.com/snivilised/agenor/internal/enclave"
"github.com/snivilised/agenor/internal/kernel"
"github.com/snivilised/agenor/internal/third/lo"
"github.com/snivilised/agenor/pref"
"github.com/snivilised/jaywalk/src/agenor/enums"
"github.com/snivilised/jaywalk/src/agenor/internal/enclave"
"github.com/snivilised/jaywalk/src/agenor/internal/kernel"
"github.com/snivilised/jaywalk/src/internal/third/lo"
"github.com/snivilised/jaywalk/src/agenor/pref"
)

type buildArtefacts struct {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
. "github.com/onsi/gomega"

"github.com/onsi/gomega/types"
"github.com/snivilised/agenor/collections"
"github.com/snivilised/jaywalk/src/agenor/collections"
)

// === HaveSize
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/snivilised/agenor/collections"
"github.com/snivilised/agenor/internal/third/lo"
"github.com/snivilised/jaywalk/src/agenor/collections"
"github.com/snivilised/jaywalk/src/internal/third/lo"
)

const (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package collections

import (
"github.com/snivilised/agenor/internal/third/lo"
"github.com/snivilised/jaywalk/src/internal/third/lo"
"golang.org/x/exp/constraints"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/snivilised/agenor/collections"
lab "github.com/snivilised/agenor/internal/laboratory"
"github.com/snivilised/jaywalk/src/agenor/collections"
lab "github.com/snivilised/jaywalk/src/agenor/internal/laboratory"
)

var (
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/snivilised/agenor/collections"
"github.com/snivilised/jaywalk/src/agenor/collections"
)

var _ = Describe("Stack", func() {
Expand Down
4 changes: 2 additions & 2 deletions composites.go → src/agenor/composites.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package age
package agenor

import (
"github.com/snivilised/agenor/pref"
"github.com/snivilised/jaywalk/src/agenor/pref"
"github.com/snivilised/pants"
)

Expand Down
24 changes: 12 additions & 12 deletions composites_test.go → src/agenor/composites_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package age_test
package agenor_test

import (
"context"
Expand All @@ -8,17 +8,17 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

age "github.com/snivilised/agenor"
lab "github.com/snivilised/agenor/internal/laboratory"
"github.com/snivilised/agenor/internal/services"
"github.com/snivilised/agenor/locale"
"github.com/snivilised/agenor/pref"
"github.com/snivilised/jaywalk/src/agenor"
lab "github.com/snivilised/jaywalk/src/agenor/internal/laboratory"
"github.com/snivilised/jaywalk/src/internal/services"
"github.com/snivilised/jaywalk/locale"
"github.com/snivilised/jaywalk/src/agenor/pref"
"github.com/snivilised/li18ngo"
)

var (
primeFacade = &pref.Using{
Subscription: age.SubscribeFiles,
Subscription: agenor.SubscribeFiles,
Head: pref.Head{
Handler: noOpHandler,
},
Expand All @@ -30,7 +30,7 @@ var (
Handler: noOpHandler,
},
From: "path-to-json-file",
Strategy: age.ResumeStrategyFastward,
Strategy: agenor.ResumeStrategyFastward,
}
)

Expand Down Expand Up @@ -70,7 +70,7 @@ var _ = Describe("Composites", Ordered, func() {
DescribeTable("hydra",
func(specCtx SpecContext, entry *lab.CompositeTE) {
lab.WithTestContext(specCtx, func(ctx context.Context, _ context.CancelFunc) {
_, _ = age.Hydra(
_, _ = agenor.Hydra(
entry.IsWalk,
entry.IsPrime,
&wg,
Expand Down Expand Up @@ -121,7 +121,7 @@ var _ = Describe("Composites", Ordered, func() {
DescribeTable("hare",
func(specCtx SpecContext, entry *lab.CompositeTE) {
lab.WithTestContext(specCtx, func(ctx context.Context, _ context.CancelFunc) {
_, _ = age.Hare(entry.IsPrime, &wg)(entry.Facade).Navigate(ctx)
_, _ = agenor.Hare(entry.IsPrime, &wg)(entry.Facade).Navigate(ctx)
})

wg.Wait()
Expand All @@ -148,7 +148,7 @@ var _ = Describe("Composites", Ordered, func() {
DescribeTable("tortoise",
func(specCtx SpecContext, entry *lab.CompositeTE) {
lab.WithTestContext(specCtx, func(ctx context.Context, _ context.CancelFunc) {
_, _ = age.Tortoise(entry.IsPrime)(entry.Facade).Navigate(ctx)
_, _ = agenor.Tortoise(entry.IsPrime)(entry.Facade).Navigate(ctx)
})
},
FormatCompositeTestDescription,
Expand All @@ -173,7 +173,7 @@ var _ = Describe("Composites", Ordered, func() {
DescribeTable("goldfish",
func(specCtx SpecContext, entry *lab.CompositeTE) {
lab.WithTestContext(specCtx, func(ctx context.Context, _ context.CancelFunc) {
_, _ = age.Goldfish(entry.IsWalk, &wg)(entry.Facade).Navigate(ctx)
_, _ = agenor.Goldfish(entry.IsWalk, &wg)(entry.Facade).Navigate(ctx)
})

wg.Wait()
Expand Down
4 changes: 2 additions & 2 deletions concurrent-defs.go → src/agenor/concurrent-defs.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package age
package agenor

import (
"github.com/snivilised/agenor/core"
"github.com/snivilised/jaywalk/src/agenor/core"
"github.com/snivilised/pants"
)

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions core/core-defs.go → src/agenor/core/core-defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"path/filepath"
"time"

"github.com/snivilised/agenor/enums"
"github.com/snivilised/agenor/tfs"
"github.com/snivilised/jaywalk/src/agenor/enums"
"github.com/snivilised/jaywalk/src/agenor/tfs"
)

type (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion core/errors_test.go → src/agenor/core/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
. "github.com/onsi/gomega"
"github.com/pkg/errors"

"github.com/snivilised/agenor/core"
"github.com/snivilised/jaywalk/src/agenor/core"
)

var _ = Describe("Variable untranslated Errors", func() {
Expand Down
2 changes: 1 addition & 1 deletion core/filtering.go → src/agenor/core/filtering.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package core
import (
"io/fs"

"github.com/snivilised/agenor/enums"
"github.com/snivilised/jaywalk/src/agenor/enums"
)

type (
Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading