Skip to content

Close SPDD gaps for forecast discovery, frontmatter hash limits, and related specs#31984

Merged
pelikhan merged 2 commits into
mainfrom
copilot/spdd-daily-spec-work-plan-2026-05-13
May 13, 2026
Merged

Close SPDD gaps for forecast discovery, frontmatter hash limits, and related specs#31984
pelikhan merged 2 commits into
mainfrom
copilot/spdd-daily-spec-work-plan-2026-05-13

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

This PR addresses the May 13 SPDD review items across the forecast, frontmatter-hash, effective-tokens, experiments, and fuzzy-schedule specs. The main code changes close the two sync gaps called out in the plan: forecast discovery now degrades predictably under GitHub API rate limiting, and frontmatter hashing now enforces the 1 MiB safeguard at runtime.

  • Forecast: rate-limit backoff + partial discovery

    • Add bounded retry/backoff for remote workflow discovery and run sampling in pkg/cli/forecast.go
    • Continue with caller-supplied workflow IDs as partial results when remote discovery is rate-limited after retries
    • Surface degraded-discovery behavior as warnings instead of hard-failing the entire forecast path
    if len(ids) > 0 {
    	fmt.Fprintln(os.Stderr, console.FormatWarningMessage(
    		fmt.Sprintf("GitHub API rate limit exhausted while discovering workflows in %s; continuing with caller-supplied workflow IDs as partial results",
    			repoOverride)))
    
    	partialWorkflows := make(map[string]*GitHubWorkflow, len(ids))
    	for _, id := range ids {
    		partialWorkflows[id] = &GitHubWorkflow{Name: id, Path: id, State: "unknown"}
    	}
    	return partialWorkflows, nil
    }
  • Frontmatter hash: enforce S-6 at runtime

    • Add a normalized-input size guard in pkg/parser/frontmatter_hash.go
    • Reject cumulative normalized frontmatter input above 1 MiB with a deterministic error
    • Add a focused compliance test in pkg/parser/frontmatter_hash_test.go
  • Forecast specification alignment

    • Add remote discovery rate-limit requirements and partial-result behavior
    • Add T-FC-030 coverage for rate-limit fallback
    • Add the missing historical sample staleness requirement and --max-age spec entry
  • Spec maintenance updates

    • Effective Tokens: define overflow ceiling/flagging behavior and clarify partial aggregation ordering for deeper sub-agent graphs
    • Experiments: attach Draft→CR promotion criteria to an explicit tracking issue
    • Frontmatter Hash: replace prose-only v2 migration prerequisites with tracked checklist items
    • Fuzzy Schedule: add the calendar output schema section and a concise v1.2.0 change summary

Copilot AI linked an issue May 13, 2026 that may be closed by this pull request
12 tasks
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b338c9e2-a6f7-4596-80e2-88d1b47db9d6

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Review daily SPDD spec work plan for 2026-05-13 Close SPDD gaps for forecast discovery, frontmatter hash limits, and related specs May 13, 2026
Copilot AI requested a review from gh-aw-bot May 13, 2026 17:04
@pelikhan pelikhan marked this pull request as ready for review May 13, 2026 17:10
Copilot AI review requested due to automatic review settings May 13, 2026 17:10
@pelikhan pelikhan merged commit 52a7101 into main May 13, 2026
@pelikhan pelikhan deleted the copilot/spdd-daily-spec-work-plan-2026-05-13 branch May 13, 2026 17:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates forecast rate-limit handling, enforces a frontmatter hash input-size guard in Go, and aligns several reference specifications with recent SPDD review items.

Changes:

  • Added retry/backoff wrappers for forecast workflow discovery and run sampling.
  • Added a 1 MiB normalized frontmatter hash input limit and a focused test.
  • Updated reference specs for forecast, frontmatter hash migration tracking, effective tokens, experiments, and fuzzy schedule calendar output.
Show a summary per file
File Description
pkg/parser/frontmatter_hash.go Adds normalized frontmatter input-size validation before hashing.
pkg/parser/frontmatter_hash_test.go Adds a test for oversized frontmatter hash input rejection.
pkg/cli/forecast.go Adds rate-limit retry/backoff wrappers for workflow discovery and run sampling.
pkg/cli/forecast_montecarlo_test.go Adds coverage for remote workflow discovery fallback under rate limiting.
docs/src/content/docs/reference/fuzzy-schedule-specification.md Documents calendar heatmap output schema and v1.2.0 draft notes.
docs/src/content/docs/reference/frontmatter-hash-specification.md Converts v2 migration prerequisites into tracked checklist items.
docs/src/content/docs/reference/forecast-specification.md Adds rate-limit fallback requirements, --max-age spec text, and test ID updates.
docs/src/content/docs/reference/experiments-specification.md Adds tracking issue references to Draft→CR promotion criteria.
docs/src/content/docs/reference/effective-tokens-specification.md Adds deeper sub-agent aggregation ordering and overflow flagging requirements.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 9/9 changed files
  • Comments generated: 5

Comment on lines +480 to +481
if err := validateFrontmatterHashInputSize(normalizedFrontmatterText, normalizedImportedTexts); err != nil {
return "", err
Comment thread pkg/cli/forecast.go
}

runs, _, err := listWorkflowRunsWithPagination(opts)
runs, _, err := listRunsWithBackoff(opts, result.WorkflowID)
| `--days` | int | `30` | Length of the historical sampling window in days. Permitted values: `7`, `30`. |
| `--period` | string | `"month"` | Projection period length. Permitted values: `"week"`, `"month"`. |
| `--sample` | int | `100` | Maximum number of completed runs to sample per workflow. MUST be ≥ 1. |
| `--max-age` | int | `90` | Maximum age in days for historical runs eligible for sampling. Implementations SHOULD discard runs older than this bound unless the caller overrides it. MUST be ≥ 1. |
Comment thread pkg/cli/forecast.go
Comment on lines +399 to +403
func listRunsWithBackoff(opts ListWorkflowRunsOptions, workflowID string) ([]WorkflowRun, int, error) {
var lastErr error

for attempt := 1; attempt <= forecastRateLimitMaxAttempts; attempt++ {
runs, total, err := forecastListWorkflowRunsPaginated(opts)
Comment on lines +475 to +480
normalizedImportedTexts := make([]string, len(importedFrontmatterTexts))
for i, text := range importedFrontmatterTexts {
normalizedImportedTexts[i] = normalizeFrontmatterText(text)
}

if err := validateFrontmatterHashInputSize(normalizedFrontmatterText, normalizedImportedTexts); err != nil {
Copilot AI added a commit that referenced this pull request May 26, 2026
- [/spdd-sync] Add Appendix B sync comment on poissonNormalApproximationThreshold in
  forecast_montecarlo.go (closes #31985)
- [/spdd-sync] Add TestForecastWorkflow_LambdaConsistencyAcrossOutputFormats in
  forecast_test.go verifying verbose/JSON output use same λ (closes #31984)
- [/spdd-generate] Replace future-state note in frontmatter-hash-specification.md §2 with
  formal deferral note referencing #31983
- [/spdd-generate] Elevate idempotency in mcp-scripts-specification.md §5.7 to normative
  SHOULD with example
- [/spdd-generate] Add T-FZ-L3-001..005 Level 3 compliance test IDs and §10.2.8 group
  definitions to fuzzy-schedule-specification.md §10
- [/spdd-analysis] Confirm fuzzy-schedule-specification.md §12 is complete (not stub);
  add audit note to sync notes
- [/spdd-sync] Add TestModelMultipliersNoPlaceholders (R-REG-007) to
  effective_tokens_test.go + make validate-registry target
- [/spdd-reasons-canvas] Add §7.6 Norms subsection (secret rotation + secret scope) to
  mcp-scripts-specification.md §7 Security Model
- Update forecast-specification.md §13 sync notes to mark #31984 and #31985 resolved
- Update effective-tokens-specification.md sync notes to document R-REG-007 automation

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[spdd] Daily spec work plan - 2026-05-13

4 participants