Documentation
¶
Overview ¶
Package forge implements configured, guarded issue imports and upstream drift checks for local UI workflows.
Index ¶
- Constants
- Variables
- func BaselineRevision(baseline store.ImportBaseline) string
- func IssueADR(issue Issue) string
- func NewHTTPClient() *http.Client
- func StripLinkTags(tags []string) []string
- func ValidRevision(revision string) bool
- func ValidSourceName(name string) bool
- type Draft
- type Drift
- type Duplicate
- type Error
- type ForgeProbeConfig
- type ForgeProber
- type Issue
- type LinkInput
- type Preview
- type PreviewRequest
- type Ref
- type Service
- func (s *Service) AcceptDrift(ctx context.Context, user, source, externalKey, revision string) (string, error)
- func (s *Service) CheckDrift(ctx context.Context, user, source, externalKey string) (Drift, error)
- func (s *Service) CreateTask(user, sourceName string, task board.Task, item LinkInput) (board.Task, error)
- func (s *Service) DeleteSource(user, name string) error
- func (s *Service) Preview(ctx context.Context, user string, request PreviewRequest) (Preview, error)
- func (s *Service) Probe(ctx context.Context, user string, config ForgeProbeConfig) error
- func (s *Service) Provenance(user, link string) ([]store.ImportLink, error)
- func (s *Service) RecordLinks(user, sourceName string, items []LinkInput) error
- func (s *Service) ResolveIssueDocument(ctx context.Context, user, source, raw string) (Issue, string, string, error)
- func (s *Service) SaveSource(user, name, kind string, baseURL, token *string) (bool, error)
- func (s *Service) Sources(user string) ([]store.ForgeSource, error)
Constants ¶
const ImportFetchTimeout = importFetchTimeout
ImportFetchTimeout bounds one forge selection independently of an AI run.
const ( // SkillRunDeadline bounds an assistant run shared by local interfaces. SkillRunDeadline = 4 * time.Minute )
Variables ¶
var ErrUpstreamChanged = errors.New("upstream changed; check again")
ErrUpstreamChanged is returned when a baseline revision no longer names the current upstream snapshot.
Functions ¶
func BaselineRevision ¶
func BaselineRevision(baseline store.ImportBaseline) string
BaselineRevision identifies one accepted upstream snapshot for compare-and-swap.
func NewHTTPClient ¶
NewHTTPClient returns the guarded forge client shared by every caller.
func StripLinkTags ¶
StripLinkTags removes model-proposed forge identity tags before the local import path appends authorized provenance.
func ValidRevision ¶
ValidRevision reports whether a drift revision is a canonical digest.
func ValidSourceName ¶
ValidSourceName reports whether a source name is safe for persisted lookup.
Types ¶
type Draft ¶
type Draft struct {
ai.Draft
Link string
ExternalKey string
URL string
SourceName string
Baseline store.ImportBaseline
Duplicate *Duplicate
}
Draft is one import proposal with its forge provenance and duplicate hint.
type Error ¶
Error is a caller-safe failure category for local UI workflows. Cause is retained for errors.Is/As and logs, never display.
type ForgeProbeConfig ¶
type ForgeProbeConfig struct {
Name string
Kind string
BaseURL string
Project string
Token string
Saved bool
}
ForgeProbeConfig is one connection test candidate. Saved selects whether blank endpoint credentials may fall back to the named stored integration; drafts set it false and are tested entirely from these unsaved values. Project is probe-only and is never persisted with the integration.
type ForgeProber ¶
type ForgeProber struct {
// contains filtered or unexported fields
}
ForgeProber tests stored or draft forge integration values. Local UI flows share its guarded client, credential-origin rule, endpoint derivation, and response handling.
func NewForgeProber ¶
func NewForgeProber(st *store.Store) *ForgeProber
NewForgeProber constructs a direct-store forge connection prober.
func NewForgeProberWithClient ¶
func NewForgeProberWithClient(st *store.Store, client *http.Client) *ForgeProber
func (*ForgeProber) Probe ¶
func (p *ForgeProber) Probe(ctx context.Context, user string, config ForgeProbeConfig) error
Probe tests one unsaved candidate. Persisted rows may retain blank stored endpoint values; drafts never touch the store. A stored token is never sent to a supplied origin that differs from the saved one.
type PreviewRequest ¶
type Ref ¶
type Ref struct {
Source store.ForgeSource
Kind string
Project string
Issue int
Milestone int
// contains filtered or unexported fields
}
Ref is a parsed configured forge selection. Its credential remains private.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns the guarded forge path used by the TUI.
func New ¶
New constructs the direct-store forge service. Nil collaborators select the guarded production clients.
func (*Service) AcceptDrift ¶
func (*Service) CheckDrift ¶
func (*Service) CreateTask ¶
func (s *Service) CreateTask(user, sourceName string, task board.Task, item LinkInput) (board.Task, error)
CreateTask atomically creates one selected card, its provenance, and the upstream baseline captured by the preview.
func (*Service) DeleteSource ¶
func (*Service) Preview ¶
func (s *Service) Preview(ctx context.Context, user string, request PreviewRequest) (Preview, error)
Preview fetches, classifies and transforms one configured selection. It is read-only: third-party forge text cannot receive write or fetch tools.
func (*Service) Provenance ¶
func (s *Service) Provenance(user, link string) ([]store.ImportLink, error)
func (*Service) RecordLinks ¶
RecordLinks journals provenance for compatibility clients that already created their cards. The TUI uses CreateTask for an atomic write.
func (*Service) ResolveIssueDocument ¶
func (s *Service) ResolveIssueDocument(ctx context.Context, user, source, raw string) (Issue, string, string, error)
ResolveIssueDocument authorizes and fetches one configured issue for a local ADR split flow.
func (*Service) SaveSource ¶
SaveSource validates and persists one configured forge source.