Documentation
¶
Overview ¶
Package orgie implements the organize-text format: a hierarchical, tag-headed text view of tagged/typed objects that round-trips through an editor (or, since #7, the MCP organize_plan/organize_commit tools) to apply bulk tag/description/move changes.
orgie-extract: this package is a candidate for extraction into a standalone amarbel-llc/orgie module — a general tool for applying structured, hierarchical mutations to tagged/typed objects. Two follow-ups shape that boundary: (#3) a structured (JSON / box-format) alternative to the text round-trip below, and object-signature drift detection between plan and commit (signatures embedded in the text/JSON let a commit detect that the underlying objects changed since the plan, and fail or merge). The SKU coupling lives only at the leaf (obj wrapper) and the GetSkus/addToSet mutation; the Assignment tree itself is object-agnostic.
Index ¶
- type Assignment
- func (assignment *Assignment) AddObject(object *obj) (err error)
- func (assignment Assignment) AlignmentSpacing() int
- func (assignment *Assignment) AllTags(tags ids.TagSetMutable) (err error)
- func (assignment *Assignment) Contains(e *ids.TagStruct) bool
- func (assignment Assignment) GetDepth() int
- func (assignment Assignment) MaxDepth() (depth int)
- func (assignment Assignment) MaxLen() (maxLength int)
- func (assignment *Assignment) SortChildren()
- func (assignment Assignment) String() (s string)
- func (assignment *Assignment) SubtractFromSet(tagsToSubtract ids.TagSetMutable) (err error)
- type Changes
- type ErrorRead
- type Flags
- func (flagz *Flags) GetOptions(printOptions options_print.Options, tagSet ids.TagSet, ...) Options
- func (flagz *Flags) GetOptionsWithMetadata(printOptions options_print.Options, boxFormat *box_format.BoxCheckedOut, ...) Options
- func (flagz *Flags) SetFlagDefinitions(flagDefs interfaces.CLIFlagDefinitions)
- type Metadata
- func (metadata Metadata) AsMetadata() (m1 objects.MetadataMutable)
- func (metadata Metadata) GetMetadataWriterTo() hyphence.MetadataWriterTo
- func (metadata *Metadata) GetTags() ids.TagSet
- func (metadata Metadata) HasMetadataContent() bool
- func (metadata *Metadata) ReadFrom(reader io.Reader) (n int64, err error)
- func (metadata Metadata) RemoveFromTransacted(object sku.SkuType) (err error)
- func (metadata *Metadata) SetFromObjectMetadata(otherMetadata objects.MetadataMutable, repoId ids.RepoId) (err error)
- func (metadata Metadata) WriteTo(w1 io.Writer) (n int64, err error)
- type Objects
- type OptionComment
- type OptionCommentBooleanFlag
- type OptionCommentDryRun
- type OptionCommentSet
- func (ocs *OptionCommentSet) AddPrototype(key string, o OptionComment) OptionComment
- func (ocs *OptionCommentSet) AddPrototypeAndOption(key string, o OptionComment) OptionComment
- func (ocs *OptionCommentSet) GetPrototypeOptionComments() PrototypeOptionComments
- func (ocs *OptionCommentSet) Set(v string) (err error)
- type OptionCommentUnknown
- type OptionCommentWithApply
- type OptionCommentWithKey
- type Options
- type OrganizeResults
- type PrefixSet
- func (prefixSet *PrefixSet) Add(object *obj) (err error)
- func (prefixSet *PrefixSet) AddSku(object sku.SkuType) (err error)
- func (prefixSet PrefixSet) AllObjectSets() interfaces.Seq2[string, objSet]
- func (prefixSet PrefixSet) AllObjects() interfaces.Seq2[string, *obj]
- func (prefixSet PrefixSet) Len() int
- func (prefixSet PrefixSet) Match(tag ids.TagStruct) (out Segments)
- func (prefixSet PrefixSet) Subset(tag ids.TagStruct) (out Segments)
- func (prefixSet PrefixSet) Subtract(objects objSet) (output PrefixSet)
- type PrototypeOptionComments
- type Refiner
- type Segments
- type SkuMapWithOrder
- func (sm *SkuMapWithOrder) Add(sk sku.SkuType) error
- func (smwo *SkuMapWithOrder) AllSkuAndIndex() interfaces.Seq2[int, sku.SkuType]
- func (smwo *SkuMapWithOrder) AsExternalLikeSet() sku.SkuTypeSetMutable
- func (smwo *SkuMapWithOrder) AsTransactedSet() sku.TransactedMutableSet
- func (sm *SkuMapWithOrder) Clone() (out SkuMapWithOrder)
- func (sm *SkuMapWithOrder) Del(sk sku.SkuType) error
- func (sm *SkuMapWithOrder) Len() int
- func (sm SkuMapWithOrder) Sorted() (out []sku.SkuType)
- type TagSetGetter
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assignment ¶
type Assignment struct {
sku.Transacted
IsRoot bool
Depth int
Objects
Children []*Assignment
Parent *Assignment
// contains filtered or unexported fields
}
func (*Assignment) AddObject ¶
func (assignment *Assignment) AddObject(object *obj) (err error)
func (Assignment) AlignmentSpacing ¶
func (assignment Assignment) AlignmentSpacing() int
func (*Assignment) AllTags ¶
func (assignment *Assignment) AllTags(tags ids.TagSetMutable) (err error)
func (*Assignment) Contains ¶
func (assignment *Assignment) Contains(e *ids.TagStruct) bool
func (Assignment) GetDepth ¶
func (assignment Assignment) GetDepth() int
func (Assignment) MaxDepth ¶
func (assignment Assignment) MaxDepth() (depth int)
func (Assignment) MaxLen ¶
func (assignment Assignment) MaxLen() (maxLength int)
func (*Assignment) SortChildren ¶
func (assignment *Assignment) SortChildren()
func (Assignment) String ¶
func (assignment Assignment) String() (s string)
func (*Assignment) SubtractFromSet ¶
func (assignment *Assignment) SubtractFromSet( tagsToSubtract ids.TagSetMutable, ) (err error)
type Changes ¶
type Changes struct {
Before, After SkuMapWithOrder
Added, Removed SkuMapWithOrder
Changed SkuMapWithOrder
}
func ChangesFrom ¶
func ChangesFrom( po options_print.Options, a, b *Text, original sku.SkuTypeSet, ) (c Changes, err error)
func ChangesFromResults ¶
func ChangesFromResults( po options_print.Options, results OrganizeResults, ) (c Changes, err error)
type ErrorRead ¶
type ErrorRead struct {
// contains filtered or unexported fields
}
type Flags ¶
type Flags struct {
Options
ExtraTags collections_ptr.Flag[ids.TagStruct, *ids.TagStruct]
// contains filtered or unexported fields
}
func (*Flags) GetOptions ¶
func (flagz *Flags) GetOptions( printOptions options_print.Options, tagSet ids.TagSet, skuBoxFormat *box_format.BoxCheckedOut, abbr ids.Abbr, objectFactory sku.ObjectFactory, ) Options
func (*Flags) GetOptionsWithMetadata ¶
func (flagz *Flags) GetOptionsWithMetadata( printOptions options_print.Options, boxFormat *box_format.BoxCheckedOut, abbr ids.Abbr, objectFactory sku.ObjectFactory, metadata Metadata, ) Options
func (*Flags) SetFlagDefinitions ¶
func (flagz *Flags) SetFlagDefinitions(flagDefs interfaces.CLIFlagDefinitions)
type Metadata ¶
type Metadata struct {
ids.TagSet
Matchers interfaces.Set[sku.Query] // TODO remove
OptionCommentSet
Type ids.TypeStruct
RepoId ids.RepoId
}
TODO replace with embedded *sku.Transacted
func NewMetadataWithOptionCommentLookup ¶
func NewMetadataWithOptionCommentLookup( repoId ids.RepoId, elements map[string]OptionComment, ) Metadata
func (Metadata) AsMetadata ¶
func (metadata Metadata) AsMetadata() (m1 objects.MetadataMutable)
func (Metadata) GetMetadataWriterTo ¶
func (metadata Metadata) GetMetadataWriterTo() hyphence.MetadataWriterTo
func (*Metadata) ReadFrom ¶
func (Metadata) RemoveFromTransacted ¶
func (*Metadata) SetFromObjectMetadata ¶
type Objects ¶
type Objects []*obj
func (*Objects) All ¶
func (os *Objects) All() interfaces.Seq2[int, *obj]
type OptionComment ¶
type OptionComment interface {
CloneOptionComment() OptionComment
interfaces.StringerSetter
}
type OptionCommentBooleanFlag ¶
func (OptionCommentBooleanFlag) CloneOptionComment ¶
func (ocf OptionCommentBooleanFlag) CloneOptionComment() OptionComment
func (OptionCommentBooleanFlag) Set ¶
func (ocf OptionCommentBooleanFlag) Set(v string) (err error)
func (OptionCommentBooleanFlag) String ¶
func (ocf OptionCommentBooleanFlag) String() string
type OptionCommentDryRun ¶
type OptionCommentDryRun struct {
mad_domain_interfaces.MutableConfigDryRun
}
func (*OptionCommentDryRun) CloneOptionComment ¶
func (ocf *OptionCommentDryRun) CloneOptionComment() OptionComment
func (*OptionCommentDryRun) Set ¶
func (ocf *OptionCommentDryRun) Set(v string) (err error)
func (*OptionCommentDryRun) String ¶
func (ocf *OptionCommentDryRun) String() string
type OptionCommentSet ¶
type OptionCommentSet struct {
OptionComments []OptionComment
// contains filtered or unexported fields
}
func MakeOptionCommentSet ¶
func MakeOptionCommentSet( elements map[string]OptionComment, options ...OptionComment, ) OptionCommentSet
TODO add config to automatically add dry run if necessary
func (*OptionCommentSet) AddPrototype ¶
func (ocs *OptionCommentSet) AddPrototype( key string, o OptionComment, ) OptionComment
func (*OptionCommentSet) AddPrototypeAndOption ¶
func (ocs *OptionCommentSet) AddPrototypeAndOption( key string, o OptionComment, ) OptionComment
func (*OptionCommentSet) GetPrototypeOptionComments ¶
func (ocs *OptionCommentSet) GetPrototypeOptionComments() PrototypeOptionComments
func (*OptionCommentSet) Set ¶
func (ocs *OptionCommentSet) Set(v string) (err error)
type OptionCommentUnknown ¶
type OptionCommentUnknown struct {
Value string
}
func (OptionCommentUnknown) CloneOptionComment ¶
func (ocf OptionCommentUnknown) CloneOptionComment() OptionComment
func (*OptionCommentUnknown) Set ¶
func (ocf *OptionCommentUnknown) Set(v string) (err error)
func (OptionCommentUnknown) String ¶
func (ocf OptionCommentUnknown) String() string
type OptionCommentWithApply ¶
type OptionCommentWithApply interface {
OptionComment
ApplyToText(Options, *Assignment) error
ApplyToReader(Options, *reader) error
ApplyToWriter(Options, *writer) error
}
type OptionCommentWithKey ¶
type OptionCommentWithKey struct {
Key string
OptionComment
}
TODO add support for ApplyTo*
func (OptionCommentWithKey) CloneOptionComment ¶
func (ocf OptionCommentWithKey) CloneOptionComment() OptionComment
func (OptionCommentWithKey) Set ¶
func (ocf OptionCommentWithKey) Set(v string) (err error)
func (OptionCommentWithKey) String ¶
func (ocf OptionCommentWithKey) String() string
type Options ¶
type Options struct {
Config mad_domain_interfaces.MutableConfigDryRun
Metadata
GroupingTags ids.TagSlice
ExtraTags ids.TagSet
Skus sku.SkuTypeSet
sku.ObjectFactory
Abbr ids.Abbr
UsePrefixJoints bool
UseRefiner bool
UseMetadataHeader bool
Limit int
PrintOptions options_print.Options
// contains filtered or unexported fields
}
type OrganizeResults ¶
type OrganizeResults struct {
Before, After *Text
Original sku.SkuTypeSet
QueryGroup *queries.Query
}
orgie-extract: OrganizeResults (Before/After/Original) and ChangesFromResults are the diff seam. Today drift between a plan and its commit is invisible — Before is re-derived from the query at commit time. A follow-up keys drift detection here on object signatures carried in the organize text/JSON, so a commit can fail (or merge) when Original changed since the plan. TODO combine with above
type PrefixSet ¶
type PrefixSet struct {
// contains filtered or unexported fields
}
func (*PrefixSet) Add ¶
this splits on right-expanded
func (PrefixSet) AllObjectSets ¶
func (prefixSet PrefixSet) AllObjectSets() interfaces.Seq2[string, objSet]
func (PrefixSet) AllObjects ¶
func (prefixSet PrefixSet) AllObjects() interfaces.Seq2[string, *obj]
type PrototypeOptionComments ¶
type PrototypeOptionComments map[string]OptionComment
type Refiner ¶
func (*Refiner) Refine ¶
func (atc *Refiner) Refine(a *Assignment) (err error)
passed-in assignment may be nil?
type SkuMapWithOrder ¶
type SkuMapWithOrder struct {
// contains filtered or unexported fields
}
func MakeSkuMapWithOrder ¶
func MakeSkuMapWithOrder(c int) (out SkuMapWithOrder)
func (*SkuMapWithOrder) Add ¶
func (sm *SkuMapWithOrder) Add(sk sku.SkuType) error
func (*SkuMapWithOrder) AllSkuAndIndex ¶
func (smwo *SkuMapWithOrder) AllSkuAndIndex() interfaces.Seq2[int, sku.SkuType]
func (*SkuMapWithOrder) AsExternalLikeSet ¶
func (smwo *SkuMapWithOrder) AsExternalLikeSet() sku.SkuTypeSetMutable
func (*SkuMapWithOrder) AsTransactedSet ¶
func (smwo *SkuMapWithOrder) AsTransactedSet() sku.TransactedMutableSet
func (*SkuMapWithOrder) Clone ¶
func (sm *SkuMapWithOrder) Clone() (out SkuMapWithOrder)
func (*SkuMapWithOrder) Del ¶
func (sm *SkuMapWithOrder) Del(sk sku.SkuType) error
func (*SkuMapWithOrder) Len ¶
func (sm *SkuMapWithOrder) Len() int
func (SkuMapWithOrder) Sorted ¶
func (sm SkuMapWithOrder) Sorted() (out []sku.SkuType)
type Text ¶
type Text struct {
Options
*Assignment // TODO make not embedded
}
func (*Text) GetSkus ¶
func (ot *Text) GetSkus( original sku.SkuTypeSet, ) (out SkuMapWithOrder, err error)
func (*Text) ReadFrom ¶
orgie-extract: ReadFrom/WriteTo are the text-format seam. #3 adds a structured (JSON / box-format) alternative alongside this hyphence text round-trip; object signatures (for plan↔commit drift detection) ride in the same metadata header these read/write.
Source Files
¶
- assignment.go
- changeable.go
- changes.go
- constructor.go
- constructor2.go
- errors.go
- main.go
- metadata.go
- option.go
- options.go
- reader.go
- refiner.go
- set_prefix_transacted.go
- structs.go
- writer.go