-
Notifications
You must be signed in to change notification settings - Fork 2
feat: send previousDomains on full refresh to stabilize domain names #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ import ( | |||||
| "io" | ||||||
| "mime/multipart" | ||||||
| "net/http" | ||||||
| "net/url" | ||||||
| "os" | ||||||
| "path/filepath" | ||||||
| "time" | ||||||
|
|
@@ -115,11 +116,26 @@ func (c *Client) pollLoop(ctx context.Context, post func() (*JobResponse, error) | |||||
| return job, nil | ||||||
| } | ||||||
|
|
||||||
| // PreviousDomain holds domain name + subdomain count for seeding the LLM prompt. | ||||||
| type PreviousDomain struct { | ||||||
| Name string `json:"name"` | ||||||
| SubdomainCount int `json:"subdomainCount"` | ||||||
| } | ||||||
|
|
||||||
| // AnalyzeShards uploads a repository ZIP and runs the full analysis pipeline, | ||||||
| // returning the complete ShardIR response with full Node/Relationship data | ||||||
| // required for sidecar rendering (IDs, labels, properties preserved). | ||||||
| func (c *Client) AnalyzeShards(ctx context.Context, zipPath, idempotencyKey string) (*ShardIR, error) { | ||||||
| job, err := c.pollUntilComplete(ctx, zipPath, idempotencyKey) | ||||||
| // If previousDomains is non-nil, passes them as a query param to seed domain names. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix comment mismatch on the trigger condition. Line 128 says "non-nil", but the code sends ✏️ Suggested doc fix-// If previousDomains is non-nil, passes them as a query param to seed domain names.
+// If previousDomains is non-empty, passes them as a query param to seed domain names.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| func (c *Client) AnalyzeShards(ctx context.Context, zipPath, idempotencyKey string, previousDomains []PreviousDomain) (*ShardIR, error) { | ||||||
| endpoint := analyzeEndpoint | ||||||
| if len(previousDomains) > 0 { | ||||||
| pd, err := json.Marshal(previousDomains) | ||||||
| if err == nil { | ||||||
| endpoint += "?previousDomains=" + url.QueryEscape(string(pd)) | ||||||
| } | ||||||
| } | ||||||
| post := func() (*JobResponse, error) { return c.postZipTo(ctx, zipPath, idempotencyKey, endpoint) } | ||||||
| job, err := c.pollLoop(ctx, post) | ||||||
| if err != nil { | ||||||
| return nil, err | ||||||
| } | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.