Close SPDD gaps for forecast discovery, frontmatter hash limits, and related specs#31984
Merged
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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 |
| } | ||
|
|
||
| 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 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
pkg/cli/forecast.goFrontmatter hash: enforce S-6 at runtime
pkg/parser/frontmatter_hash.gopkg/parser/frontmatter_hash_test.goForecast specification alignment
T-FC-030coverage for rate-limit fallback--max-agespec entrySpec maintenance updates