Repository navigation
feat: horizon policy dates every created issue, and linear goals (PHNX-4291) - #62
Merged
Merged
Conversation
…HNX-4291) create resolves each issue to one horizon (now, milestone, backlog) and prints the defaults it applied: due date from policy.sla by priority, an SLA reminder for urgent/high, the active cycle, and the project's next open milestone. The project comes from --project or the cwd binding; with neither, create refuses and teaches the three horizons. --bug / --bug --blocker, default delegate from the configured agent, a policy block in config, and milestones set-target-date carrying its issues to the new date. linear goals reads the company quarter, week, my week, my day with to-dos and the team's goals; --json is the agi-menu contract. goals set week|day| company-week and goals todo write them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
goals todo --done only closes a to-do of today's Daily goal; a non-object policy value is a clear error, not a traceback; a failed default SLA reminder warns without failing the create (an explicit --remind-at still exits 1); an unavailable team timezone says so on stderr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Independent review (code-reviewer subagent, non-author): APPROVE. No blocking findings. It traced every horizon rule in Its non-blocking findings and what happened to each (fixup 4f8a57e):
|
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.
Refs PHNX-4291.
linear createnow gives every issue a due date, cycle and milestone by rule. A newlinear goalscommand reads and writes the company, week and day goals that agi-menu consumes.Why
Over the last 60 days, 3% of tickets had a due date and 5% had a milestone.
createput every issue in the active cycle and left the date empty.Build 1: horizon policy in
create(single and--from-file)plan_horizon, a pure function covering the rule table):policy.sla. Urgent and high are due today, with reminders at +15m and +1h. Medium is due the next working day, low at the active cycle's last day. Active cycle, and the project's next open milestone.--milestone M): due on M's target date (urgent and high keep an earlier SLA date). Active cycle only when that date falls inside it.--backlog): Backlog state, no cycle, no due date. The milestone must be a future one, defaulting topolicy.backlogMilestone("Q1 2027"). If that doesn't resolve,createrefuses.--due-date,--cycleand--status.--cycleno longer defaults toactive.--project, elseresolve_cwd_project(thelinear tasksauto-scope path). With neither,createrefuses and lists the projects.--milestone, else the earliest-target milestone under 100% (never the backlog one). If there's none,createrefuses with the catalog.--bugadds label Bug and implies backlog plus low priority.--bug --blockerimplies horizon now, high priority, and the next milestone.cfg["agent"]becomes the delegate when--delegateisn't passed. The API-key owner stays the assignee.--skip-milestoneis the escape hatch and prints a warning.policyblock in~/.linear-cli/config.json, merged per key over the defaults. Documented in the README under "Horizons".team.timezone). The fleet boxes run in UTC, and Linear's cycleendsAtis the exclusive start of the next cycle, so the "last day" is the day before that instant in the team's zone.milestones set-target-datemoves every open issue in the milestone that was due on the old target to the new one (cascade_due_dates), and prints the count.Build 2:
linear goalslinear goals --jsonfollows the shared contract:company.initiative,logoUrl,milestones,week.cycle,week.goal,meandteam. Goal objects carry their to-dos.goals_statemakes four requests andbuild_goalsis pure.week.goalis null for an empty name or one matching^Cycle \d+$.teamis the other active, non-app, non-guest users.--json): company goal with days left, the week goal, my week, my day with to-dos, then each teammate's day and week goal.--json:goals set week|day "<text>" [--milestone M]creates the goal or updates its title. A day goal is parented to the week goal.goals set company-week "<text>"renames the active cycle.goals todo "<text>"creates a sub-issue of today's goal, due today.goals todo --done <ID>marks one done.company.milestonesis the open milestones (under 100%) of the initiative's projects with a target on or before the initiative's. Today that's the three named key results plus "0.1.4 — Agent Profiles" (Oct 30, 82%).Verification
python3 -m unittest: Ran 265 tests, OK (skipped=4). The same suite passes under Python 3.9 throughuv run --python 3.9. New test classes:SlaTableTest: the default table, config overrides, +Nwd skipping a weekend, cycle last day in America/Los_Angeles.PlanHorizonTest: each horizon, urgent/high keeping an earlier date, explicit due winning.CreateHorizonTest: now, milestone, backlog, bug, bug+blocker, no project, no open milestone, explicit flags, delegate, a bad policy rule.MilestoneRetargetCascadeTest.GoalsJsonTest: the contract shape, startDate fallback, unnamed cycle, newest duplicate, human output.Real runs against the getrush workspace using the branch's
linear. Every throwaway (PHNX-4296 to 4306) was cancelled afterwards, and the throwaway milestone was deleted.What Linear stored, read back with GraphQL:
Cascade, run on a throwaway milestone:
Goals. The
teamarray and avatar URLs are omitted here because the repo is public:set company-weekwas exercised by renaming cycle 32 to its current name, which is a no-op on real data.Two runs predate small fixes in this same commit. The reminder line in the first output still shows microseconds; it now prints whole seconds. The human view's week line repeated the cycle name before it printed
Cycle 32.Behavior changes to note
createnow refuses with no project. Before,--skip-milestonewith no project created an orphan issue.createno longer puts every issue in the active cycle. Both follow the horizon now.agentconfigured, new issues are delegated to that agent.~/src/…/agentsis bound to a "Prix" project that isn't in this team.createfrom there refuses and lists the team's projects, as designed.The release (version bump, install.sh pin and tag) follows in a separate
chore(release)PR, per the repo's convention.🤖 Generated with Claude Code